Millisecs() and Debugging

BlitzMax Forums/BlitzMax Beginners Area/Millisecs() and Debugging

Haramanai(Posted 2006) [#1]
The millisecs are still running after the DebugStop()
It's logicall but it makes the debugging imposible as you can't find where the problem is.
Does anyone have a code or a technic to play with time and be possible to debug?


Dreamora(Posted 2006) [#2]
There is none as long as you don't do your own internal time system depending on mainloop runs or something similar.

If you need to debug a time problem, you might use debug output or a write to file debug with time values and what results different operation give to track the problem ...


LosButcher(Posted 2006) [#3]
You could just save the time you use to debug and then substract this whenever you need the millisecs.
An example:

Strict

Print MilliSecs()
Local time:Int = MilliSecs()
DebugStop
Local debugTime:Int = MilliSecs() - time
Print MilliSecs() - debugTime


Dreamora(Posted 2006) [#4]
This won't work. If you step through your app, the time will be wrong even after the first step already (compared to the normally running app), because the time goes on even when you stop at a code line.


LosButcher(Posted 2006) [#5]
Oh right. Wont work with steps. Cant help you there. As Dreamora says, write the times to a file to get some sort of timeline. Perhaps you could tell us what the purpose is? E.g. to time how much time it takes an object to move across the screen? Or is this for performance?


Haramanai(Posted 2006) [#6]
I have figured out what I was doing wrong.
Anyway I am trying to do an animator to move and rotate objects in time. The move method it's working right now.
Is it better to use millisecs for this job or Hertz of the refresh rare?


Dreamora(Posted 2006) [#7]
None, I would say ...
Frames per Second would be the best with the possibility to let the user choose the replay fps of the animation.