Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Versatile timer for the entropy tuner. More...
#include <timer.h>
Public Member Functions | |
Timer () | |
Constructor, resets the timer. More... | |
~Timer () | |
void | reset () |
Reset the timer and remember the current time locally. More... | |
int64_t | getMilliseconds () |
void | wait (int milliseconds) |
Wait in idle mode without consuming CPU time. More... | |
bool | timeout (int64_t milliseconds) |
Check for timeout. More... | |
void | waitUntil (int64_t milliseconds, int interval_ms=5) |
Wait in idle mode for a certain minimum time span since last reset. More... | |
Private Attributes | |
std::chrono::time_point < std::chrono::system_clock > | mStart |
Versatile timer for the entropy tuner.
This timer works like a simple clock which is set to zero at the moment of creation and whenever the function reset() is called. The class provides a function waitUntil which waits for a certain minimum time span since the last reset. It is used in the SignalAnalyzer in order to compute FFTs with a certain mininum time interval in between.
Timer::Timer | ( | ) |
void Timer::reset | ( | ) |
bool Timer::timeout | ( | int64_t | milliseconds | ) |
void Timer::wait | ( | int | milliseconds | ) |
void Timer::waitUntil | ( | int64_t | milliseconds, |
int | interval_ms = 5 |
||
) |
|
private |