Here's the timekeeping part of my current project, you might find it useful...
Then use it like this
exactly the same as LarsG's example, just more long winded and harder to follow ;)
Type _Timer Final Field Active:Byte Field LastTick:Int Field Frequency:Int Field Tick:Byte Method Update:Byte() If Active = True If LastTick + Frequency < MilliSecs() Tick = True LastTick = MilliSecs() EndIf EndIf End Method Method HasTicked:Byte() If Tick = True Then Tick = False; Return True Return False End Method Method Activate:Byte() Active = True LastTick = MilliSecs() End Method Method DeActivate:Byte() Active = False End Method Method SetFreq:Byte( NewFreq:Int ) Frequency = NewFreq End Method Method GetTimeSinceLastTick:Int() Return MilliSecs() - LastTick End Method End Type
Then use it like this
t:_Timer = New _Timer t.SetFreq(1000) t.Activate() blah blah... t.Update() If t.HasTicked() = True, 'Display next text
exactly the same as LarsG's example, just more long winded and harder to follow ;)