CTimer#

class ikomia.utils.pyutils.CTimer#

Cross-platform timer with nanoseconds precision

Import

from ikomia.utils import CTimer

Methods

__init__(arg1)

Default constructor

get_elapsed_ms(self)

Get elapsed time in ms since the last call or since the start (first call).

get_elapsed_ns(self)

Get elapsed time in ns since the last call or since the start (first call).

get_elapsed_us(self)

Get elapsed time in µs since the last call or since the start (first call).

get_total_elapsed_ms(self)

Get elapsed time in ms since the start.

get_total_elapsed_ns(self)

Get elapsed time in ns since the start.

get_total_elapsed_us(self)

Get elapsed time in µs since the start.

print_elapsed_time_ms(self, name)

Print elapsed time in ms since the last call or since the start (first call).

print_total_elapsed_time_ms(self, name)

Print elapsed time in ms since the start.

start(self)

Launch timer.

Details

__init__((object)arg1) None :#

Default constructor

get_elapsed_ms((CTimer)self) float :#

Get elapsed time in ms since the last call or since the start (first call).

Returns:

elapsed time in ms

Return type:

float

get_elapsed_ns((CTimer)self) float :#

Get elapsed time in ns since the last call or since the start (first call).

Returns:

elapsed time in ns

Return type:

float

get_elapsed_us((CTimer)self) float :#

Get elapsed time in µs since the last call or since the start (first call).

Returns:

elapsed time in µs

Return type:

float

get_total_elapsed_ms((CTimer)self) float :#

Get elapsed time in ms since the start.

Returns:

elapsed time in ms

Return type:

float

get_total_elapsed_ns((CTimer)self) float :#

Get elapsed time in ns since the start.

Returns:

elapsed time in ns

Return type:

float

get_total_elapsed_us((CTimer)self) float :#

Get elapsed time in µs since the start.

Returns:

elapsed time in µs

Return type:

float

print_elapsed_time_ms((CTimer)self, (str)name) None :#

Print elapsed time in ms since the last call or since the start (first call). String printed to the standard output stream.

Parameters:

name (str) – label identifying timed process

print_total_elapsed_time_ms((CTimer)self, (str)name) None :#

Print elapsed time in ms since the start. String printed to the standard output stream.

Parameters:

name (str) – label identifying timed process

start((CTimer)self) None :#

Launch timer.