How to write time period calculation task for a gvien frequency

Hi I have written
task(input realtime freq_in , output realtime period_out)
period_out = 1/freq_in;
endtask

My doubt is this will be equal to timescale period or need to do some conversion

Regards
DARSHAN

In reply to DARSHANKUMARKA:

If the frequency is in Hz (cycles per second), then the output is in seconds. To put it into the local timescale, use

function void convert(input realtime freq_in , output realtime period_out)
 period_out = 1s/freq_in;
endfunction

However, if the timescale in the place where defining this function is different from where you call the function, you have a problem and need to pass 1s to the function.

BTW, always use functions, not tasks for routines that do not block.