what i use isn't my code ... saw it in TMC's code and thought it was interesting - just evolved it slightly, setting up the values within array's seemed a logical step to make sure i could have multiple instances.
type TimeVec_t
current as float
duration as float
old as float
endtype
dim pTime(255) as TimeVec_t
bReact as boolean
pTime(1).old = Timer()
do
_pipeline( 1 )
if pTime( 1 ).duration > 100.0 && < 200.0
`// time based operations here
bReact = TRUE
else
bReact = FALSE
endif
sync
loop
function _pipeline( intTimer as byte )
pTime( intTimer ).current = Timer()
if bReact = FALSE
pTime( intTimer ).duration = pTime( intTimer ).duration + ( pTime( intTimer ).current - pTime( intTimer ).old )
else
pTime( intTimer ).duration = pTime( intTimer ).current - pTime( intTimer ).old
endif
pTime( intTimer ).old = pTime( intTimer ).current
endfunction
not really anything fancy ... and i'm kinda tired so i'm not sure if thats setup right hehee
can have upto 255 instances of a pipeline timer for all sorts of operations, from frame rate limitation to checking networking ping.
now that should if i've remember'd it right, check to make sure the loop time < 0.01sec but is > 0.02sec
as normally regardless of the FPS it should refreshing at the same speed as your bus, so it'll compound the loop time until it is between that result.
Obviously means you can't have everything timed perfectly, however still will give realistic enough results not to matter
using a timer is different to using the FPS because the FPS is how many times the graphics card has processed the 3D scene, whereas your timer should be a constant for your system (or atleast processor laden based)
Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?