module time
¶
Source: stdlib/time.codon
time()
¶
time_ns()
¶
monotonic()
¶
monotonic_ns()
¶
perf_counter()
¶
perf_counter_ns()
¶
sleep(secs: float)
¶
TimeInterval
¶
Utility class for timing Codon code
Fields¶
start
: int
¶
msg
: str
¶
Magic methods¶
__init__(self)
¶
__enter__(self)
¶
__exit__(self)
¶
Methods¶
report(self, msg = "", memory = False)
¶
elapsed(self)
¶
tick(self, msg, memory = False)
¶
timing(msg: str = "")
¶
Example usage:
from time import timing
with timing('foo function'):
foo() # prints runtime of foo