Resetting a timer (tTimer)

BlitzMax Forums/BlitzMax Module Tweaks/Resetting a timer (tTimer)

GfK(Posted 2006) [#1]
I've come across a situation recently where I need to reset a timer when its tick counter reaches a certain value. The only way I could find to do this, was to null the existing timer and create a new one.

I've since added the following to BRL.Timer's tTimer class, which works great:
Method Reset()
  _ticks = 0
End Method

This leaves me with a couple of questions.

1. Am I missing a better way of achieving what I set out to do (reset a timer without recreating it)?
2. Will adding the above to BRL.Timer have any adverse side effects?
3. If the answer to 1 and 2 are both "no", can the timer module include this update so I don't lose the changes each time I syncmods?


Perturbatio(Posted 2006) [#2]

1. Am I missing a better way of achieving what I set out to do (reset a timer without recreating it)?



You might be able to extend it and reset, dunno without testing though.

2. Will adding the above to BRL.Timer have any adverse side effects?

Only one I can see is syncmods