12 #ifndef ROC_CORE_TICKER_H_
13 #define ROC_CORE_TICKER_H_
32 : ratio_(double(freq) /
Second)
40 roc_panic(
"ticker: can't start ticker twice");
Base class for non-copyable objects.
Ticks elapsed()
Returns number of ticks elapsed since start. If ticker is not started yet, it is started automaticall...
void wait(Ticks ticks)
Wait until the given number of ticks elapses since start. If ticker is not started yet,...
uint64_t Ticks
Number of ticks.
Ticker(Ticks freq)
Initialize.
void start()
Start ticker.
nanoseconds_t timestamp()
Get current timestamp in nanoseconds.
void sleep_until(nanoseconds_t timestamp)
Sleep until the specified absolute time point has been reached.
const nanoseconds_t Second
One second represented in nanoseconds.
int64_t nanoseconds_t
Nanoseconds.
#define roc_panic(...)
Print error message and terminate program gracefully.