can be made but one of the problems is that such a function has some function call overhead which may or may not affect your program flow. For millis() it is probably not too bad, for micros the story is quite different.
The code for your function is something like this.
boolean checkTimeElapsedSinceLastCall(unsigned long t) // a shorter name is possible ;)
{
static unsigned long prev = 0;
unsigned long now = millis();
if (now - prev >= t)
{
prev = now;
return true;
}
return false;
}
have fun ![]()