Mojo module
time
Implements basic utils for working with time.
You can import these APIs from the time
package. For example:
from time import now
from time import now
Functions
-
now
: Deprecated: Please use time.perf_counter_ns instead. -
perf_counter
: Return the value (in fractional seconds) of a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid. -
perf_counter_ns
: Return the value (in nanoseconds) of a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid. -
sleep
: Suspends the current thread for the seconds specified. -
time_function
: Measures the time spent in the function.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!