Code to check frequency in systemverilog

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

See