km3pipe.time

Manipulating time and so…

Module Contents

Classes

Timer(message=’It’, precision=3, callback=print) A very simple, accurate and easy to use timer context
Cuckoo(interval=0, callback=print) A timed callback caller, which only executes once in a given interval.

Functions

total_seconds(td) Convert the timedelta to seconds.
tai_timestamp() Return current TAI timestamp.
np_to_datetime(intime) Convert numpy/pandas datetime64 to list[datetime].
km3pipe.time.total_seconds(td)[source]

Convert the timedelta to seconds.

class km3pipe.time.Timer(message='It', precision=3, callback=print)[source]

Bases:object

A very simple, accurate and easy to use timer context

seconds[source]
cpu_seconds[source]
start(self)[source]
stop(self)[source]
log(self)[source]
class km3pipe.time.Cuckoo(interval=0, callback=print)[source]

Bases:object

A timed callback caller, which only executes once in a given interval.

msg(self, *args, **kwargs)[source]

Only execute callback when interval is reached.

reset(self)[source]

Reset the timestamp

km3pipe.time.tai_timestamp()[source]

Return current TAI timestamp.

km3pipe.time.np_to_datetime(intime)[source]

Convert numpy/pandas datetime64 to list[datetime].