clockblocks.clock.TimeStamp

class clockblocks.clock.TimeStamp(clock: clockblocks.clock.Clock = None)[source]

Bases: object

A TimeStamp stores the beat of every Clock within a family of clocks, at a specific moment.

Parameters

clock – any clock in the family of clocks we are interested in; if None, the clock is captured implicitly from the thread

Variables
  • wall_time – the system time (given by time.time()) when this time stamp was created

  • time_in_master – the time in the master clock when this time stamp was created

  • beats_in_clocks – dictionary mapping every clock in the family tree to its beat when the TimeStamp was created.

Methods

beat_in_clock(clock)

Get what beat it was in the given clock at the moment represented by this TimeStamp.

time_in_clock(clock)

Get what time it was in the given clock at the moment represented by this TimeStamp.

beat_in_clock(clock: clockblocks.clock.Clock) → float[source]

Get what beat it was in the given clock at the moment represented by this TimeStamp.

Parameters

clock – the clock we are curious about.

Returns

the beat in that clock.

time_in_clock(clock: clockblocks.clock.Clock) → float[source]

Get what time it was in the given clock at the moment represented by this TimeStamp.

Parameters

clock – the clock we are curious about.

Returns

the time in that clock.