openledrace/open-led-race/SoftTimer.cpp
Luca Borsari 60294709c7 Ver 0.9.6
2020-12-12 17:29:55 +01:00

36 lines
472 B
C++

#include "SoftTimer.h"
SoftTimer::SoftTimer(unsigned long tout) {
this->set(tout);
}
SoftTimer::SoftTimer() {
}
/*
*
*/
void SoftTimer::set(unsigned long tout) {
this->timeout=tout;
}
void SoftTimer::start() {
this->startTime=millis();
}
void SoftTimer::start(unsigned long tout) {
this->set(tout);
this->start();
}
/*
*
*/
boolean SoftTimer::elapsed(){
if((millis() - this->startTime) > this->timeout) {
return(true);
}
return(false);
}