time

Standard library module View source
function time
time()
function time_ns
time_ns()
function monotonic
monotonic()
function monotonic_ns
monotonic_ns()
function perf_counter
perf_counter()
function perf_counter_ns
perf_counter_ns()
function sleep
sleep(secs: float)
class TimeInterval
class TimeInterval

Utility class for timing Codon code

Fields 2
start int
msg str
Constructors 1
__init__
__init__(self)
Methods 3
report
report(self, msg = "", memory = False)
elapsed
elapsed(self)
tick
tick(self, msg, memory = False)
Special methods 2
__enter__
__enter__(self)
__exit__
__exit__(self)
function timing
timing(msg: str = "")

Example usage:

from time import timing
with timing('foo function'):
    foo()  # prints runtime of foo
class struct_time
@tuple
class struct_time
Constructors 1
__new__
__new__(year: int = 0, mon: int = 0, mday: int = 0, hour: int = 0, min: int = 0, sec: int = 0, wday: int = 0, yday: int = 0, isdst: int = 0)
Properties 9
tm_year
@property
tm_year(self)
tm_yday
@property
tm_yday(self)
tm_sec
@property
tm_sec(self)
tm_min
@property
tm_min(self)
tm_hour
@property
tm_hour(self)
tm_mday
@property
tm_mday(self)
tm_mon
@property
tm_mon(self)
tm_wday
@property
tm_wday(self)
tm_isdst
@property
tm_isdst(self)
function localtime
localtime(secs: int = -1)
function gmtime
gmtime(secs: int = -1)
function mktime
mktime(t)