stanza.timing

Module Contents

Functions

NameDescription
seconds_to_nsConvert seconds to nanoseconds, rounded to the nearest integer.
to_epochConvert a timestamp to epoch time.

API

1stanza.timing.seconds_to_ns(seconds: float) -> int

Convert seconds to nanoseconds, rounded to the nearest integer.

Parameters:

Returns:

int: Time in nanoseconds

1stanza.timing.to_epoch(timestamp: float | int | datetime.datetime) -> float

Convert a timestamp to epoch time.

Parameters:

Returns:

float: Epoch time