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
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!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?