Difference Between Task and Function

How we can know that function simulation in zero time ??

In reply to p_patel:
Put a display to print simulation time before and after a function call.

In reply to p_patel:
Because the language defines it that way.

Thank Bdreku and Dave,You Both Correct.
But when we called the function,then during executing function (suppose there is some expression inside function,So for calculating them) there is no time required???Means they calculate instantly within zero time??

In reply to p_patel:
Yes, the function will execute the expression in zero time, but if there is any expression which consumes time then simulator will give an error.

Please try to run some example code to understand all these concepts.

In reply to p_patel:

When we talk about a function having zero time in a hardware description language, we really mean a function cannot block waiting for time to pass. It has nothing to do with the CPU time required to execute the code inside the function in a simulation, or the physical time it takes to propagate the result of a function implemented in real hardware.

Got It…Thanks Dave.