Class Timer

Nested Relationships

Nested Types

Class Documentation

class Timer

Provides functionality for millisecond precision timing.

Public Functions

Timer()

Construct a new Time object initialized to the current timestamp.

~Timer() = default

Destroy the Timer object.

void reset()

Reset the timer.

void wait_until(double offset)

Wait until the specified offset has occured since the last reset of the timer.

Parameters

offset – offset in microseconds

auto get_elapsed_microseconds() -> double

Get the elapsed time since the last reset in microseconds.

Returns

double elapsed time in microseconds

auto get_elapsed_milliseconds() -> int

Get the elapsed time since the last reset in milliseconds.

Returns

int elapsed time in milliseconds

void print_rates(uint64_t bytes)

Print information about the data transfer performance.

Parameters

bytes – number of bytes to use when calculating effective data rate