Speed Management

Blitz3D Forums/Blitz3D Beginners Area/Speed Management

Verminaard(Posted 2003) [#1]
howdy folks,
well, after a stressfull week of moving house, i have finally got settled back in, and my 1mb net line comes in tommorrow, so i am all happy :D Now back to BB.
I was wondering if anyone could tell me the easiest way to measure the time it takes to run parts of my code. Having been playing with blitz for about 6 weeks now, i have discovered several ways of achieving the results i want in my games, but i have no idea how to compare them for efficiency. Can anyone tell me how to read the system timer so i can measure the length of time it takes to complete a routine and also an easy way to work out a FPS count for my game? thanks folks
~V~


Ross C(Posted 2003) [#2]
Hey, well one way is to have 3 variables.

start_time
finish_time
total_time


Make start_time equal to the current timer to begin the count

start_time=millisecs()


Then when your finished testing the code

finish_time=millisecs()


then finally to work out the time passed

total_time=finish_time-start_time


the time in milliseconds taken will be stored in the total_time variable. Hope that helps!!


BlitzSupport(Posted 2003) [#3]
Try Michael Reitzenstein's preprocessor/profiler:

http://www.mking.com/~huntersd/preprocessor/features.html


Verminaard(Posted 2003) [#4]
Hmmm,
the BB preprocessor looks a bit daunting for what i want to do atm, but thanks anyway james. I'll give joker's method a go first because it seems to be simple and should suffice for what i want to do. Thanks for the help (again :D) Hell, you never know, i might even have something to stick in the showcase this week lol
~V~