Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::Ticker Class Reference

Ticker. More...

#include <ticker.h>

Inheritance diagram for roc::core::Ticker:
Collaboration diagram for roc::core::Ticker:

Public Types

typedef uint64_t ticks_t
 Number of ticks. More...
 

Public Member Functions

 Ticker (ticks_t freq)
 Initialize. More...
 
void start ()
 Start ticker. More...
 
ticks_t elapsed ()
 Returns number of ticks elapsed since start. If ticker is not started yet, it is started automatically. More...
 
void wait (ticks_t ticks)
 Wait until the given number of ticks elapses since start. If ticker is not started yet, it is started automatically. More...
 

Detailed Description

Ticker.

Definition at line 23 of file ticker.h.

Member Typedef Documentation

◆ ticks_t

typedef uint64_t roc::core::Ticker::ticks_t

Number of ticks.

Definition at line 26 of file ticker.h.

Constructor & Destructor Documentation

◆ Ticker()

roc::core::Ticker::Ticker ( ticks_t  freq)
explicit

Initialize.

Remarks
freq defines the number of ticks per second.

Member Function Documentation

◆ elapsed()

ticks_t roc::core::Ticker::elapsed ( )

Returns number of ticks elapsed since start. If ticker is not started yet, it is started automatically.

◆ start()

void roc::core::Ticker::start ( )

Start ticker.

◆ wait()

void roc::core::Ticker::wait ( ticks_t  ticks)

Wait until the given number of ticks elapses since start. If ticker is not started yet, it is started automatically.


The documentation for this class was generated from the following file: