Code to check frequency in systemverilog

Hi,
In a recent interview I was asked to write a code in systemverilog to check frequency.Please if you guys could help me with this that would be great.

Thanks

This question was asked many times. I found the following by doing a search at SystemVerilog - Verification Academy

See