typedef uint32_t clock_t; const clock_t INFINITE = ( (clock_t)(-1) ); const clock_t SEC = 1000; // // waiter: returns true and resets if more than time has passed // class waiter { clock_t last; public: waiter() : last(millis()) {} bool wait( const clock_t time ) { clock_t now = millis(); if( now - last >= time ) { last = now; return true; } return false; }; };