Skip to content
Snippets Groups Projects

Implements #134 source groups

Merged Nicolas Pope requested to merge feature/134/usegroup into master
5 files
+ 57
36
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -23,6 +23,19 @@ enum timerlevel_t {
kTimerMAXLEVEL
};
/**
* Represents a timer job for control purposes. Use to remove timer jobs in
* a destructor, for example.
*/
struct TimerHandle {
const int id = -1;
void cancel() const;
void pause() const;
void unpause() const;
TimerHandle &operator=(const TimerHandle &h) { const_cast<int&>(id) = h.id; return *this; }
};
/**
* Milliseconds between calls.
*/
@@ -44,13 +57,7 @@ void setClockAdjustment(int64_t ms);
* If all high precision callbacks together take more than 1ms to complete, a
* warning is produced.
*/
int add(timerlevel_t, const std::function<void(int64_t ts)> &);
/**
* Remove a callback using an ID returned when it was added.
*/
void remove(int);
const TimerHandle add(timerlevel_t, const std::function<void(int64_t ts)> &);
/**
* Initiate the timer and optionally block the current process.
Loading