Code: Select all
timer t;
unsigned int time;
t :> time;
for(;;)
{
select {
case t when timerafter(time) :> time:
time += 1E6;
do_something();
break;
}
}
I could throw in a bunch of code to check for this, but was wondering if there is an elegant way to handle this?