I'm going to have a bash at using timers. Something simple like this
Starttimer=millis() Endtimer=Starttimer + 500;