Time

class py123d.datatypes.Timestamp[source]

Timestamp class representing a time point in microseconds.

Public Data Attributes:

time_ns

The timestamp in nanoseconds [ns].

time_us

The timestamp in microseconds [μs].

time_ms

The timestamp in milliseconds [ms].

time_s

The timestamp in seconds [s].

Public Methods:

from_ns(t_ns)

Constructs a Timestamp from a value in nanoseconds.

from_us(t_us)

Constructs a Timestamp from a value in microseconds.

from_ms(t_ms)

from_s(t_s)

Constructs a Timestamp from a value in seconds.


classmethod from_ns(t_ns)[source]

Constructs a Timestamp from a value in nanoseconds.

Parameters:

t_ns (int) – Time in nanoseconds.

Return type:

Timestamp

Returns:

Timestamp.

classmethod from_us(t_us)[source]

Constructs a Timestamp from a value in microseconds.

Parameters:

t_us (int) – Time in microseconds.

Return type:

Timestamp

Returns:

Timestamp.

classmethod from_ms(t_ms)[source]
Return type:

Timestamp

Parameters:

t_ms (float)

classmethod from_s(t_s)[source]

Constructs a Timestamp from a value in seconds.

Parameters:

t_s (float) – Time in seconds.

Return type:

Timestamp

Returns:

Timestamp.

property time_ns: int

The timestamp in nanoseconds [ns].

property time_us: int

The timestamp in microseconds [μs].

property time_ms: float

The timestamp in milliseconds [ms].

property time_s: float

The timestamp in seconds [s].