ark::time::RolloverAwareClock

Defined in header “ark/time/rollover_aware_clock.hh”.


This is a clock that consumes timestamps in a 32-bit format, processes them, and produces timestamps in a 64-bit format. Each time the 32-bit clock rolls over, the ‘high’ bits of the 64-bit clock will advance by one.

Methods

  • RolloverAwareClock()
    Constructor. Initializes a fresh clock, with zero rollovers.

  • RolloverAwareClock(uint32_t initial_rollovers)
    Constructor. Initializes a clock with the given number of rollovers.

  • void consider_timestamp(uint32_t timestamp)
    Integrates the given timestamp into the rollover-aware clock. If the timestamp is less then the previously received timestamp, this class assumes a rollover occurred.

  • uint64_t now()
    Returns a 64-bit timestamp that represents the current time (with rollovers taken into account).

  • uint32_t last_timestamp()
    Returns the last received timestamp.

  • uint32_t rollover_count()
    Returns the number of rollovers that have occurred to date.