Add start/stop methods

This commit is contained in:
2024-01-24 09:59:11 +01:00
parent 96e5cc193e
commit fe4bbe77f9
2 changed files with 49 additions and 15 deletions

View File

@ -17,8 +17,6 @@ namespace sc {
mutable void* _context {};
timer_t _tid;
static void callback(union sigval);
public:
timer(double time,
bool repeat,
@ -34,6 +32,15 @@ namespace sc {
bool is_armed() const;
void time_left(struct itimerspec& cur_value) const;
double time_left() const;
void stop();
void start();
void start(double time, bool repeat);
private:
static void callback(union sigval);
void setup_timer(double time, bool repeat);
};
}