Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Rate limiter. More...
#include <rate_limiter.h>
Public Member Functions | |
RateLimiter (nanoseconds_t period) | |
Initialize rate limiter. More... | |
bool | would_allow () |
Check whether allow() would succeed. More... | |
bool | allow () |
Check whether an event is allowed to occur now, and if yes, mark it as occurred. More... | |
Rate limiter.
Definition at line 22 of file rate_limiter.h.
|
explicit |
Initialize rate limiter.
period
is tick duration in nanoseconds. bool roc::core::RateLimiter::allow | ( | ) |
Check whether an event is allowed to occur now, and if yes, mark it as occurred.
bool roc::core::RateLimiter::would_allow | ( | ) |
Check whether allow() would succeed.