Simple timing problem

BlitzMax Forums/BlitzMax Beginners Area/Simple timing problem

Local Hold:int = Millisecs() + AmountToDelay 
While Not KeyHit(KEY_ESCAPE)
  'This part will be delayed until Millisecs() has reached the hold time
  If Millisecs() >= Hold
    DoStuff()
  End If

  'This part will always be executed
  DoOtherStuff()
Wend