18 lines
332 B
C++
18 lines
332 B
C++
|
|
|
|
#include "Timer.h"
|
|
#include "TimerSet.h"
|
|
|
|
void Timer::timeoutRequest(int seconds) { timeToGo = seconds; }
|
|
|
|
Timer::Timer() : timeToGo(-1) { theTimerSet.addATimer(this); }
|
|
|
|
bool Timer::isExpired() {
|
|
if (timeToGo > 0) {
|
|
if (--timeToGo == 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|