i created this and it uses timer() to limit the number of screen refreshes per second. I have XP pro and the program seems to work.
It allows your main loop to do loops as fast as your computer will do them but the framerate will be constant. there are a few flaws. If you run the program through midnight, then the timer
resets back to 0 and the screen will no longer refresh.
I get an average of 300 on my computer which is an athlon xp 2500, 512 DDR, gf4 ti4800. I use this in all my projects and i use the average to limit speeds. so for gravity :-
grav#=-9.81/average#(1)
yspeed#=yspeed#+grav#
its seems to work well.
sync on
sync rate 0
autocam off
make matrix 1,1000,1000,10,10
position camera 100,100,100
dim average#(1)
dim refreshdata(4)
do
set cursor 0,0 : print average#(1)
refresh(60)
loop
function refresh(fps)
refreshdata(2)=refreshdata(2)+1
if timer()>refreshdata(1)+(1000/fps)
refreshdata(1)=timer()
refreshdata(5)=refreshdata(4)
refreshdata(4)=refreshdata(3)
refreshdata(3)=refreshdata(2)
refreshdata(2)=0
average#(1)=(refreshdata(2)+refreshdata(3)+refreshdata(4))/3
sync
endif
endfunction
The only thing im curious about is if i move the print command from the main loop into the function then i get an average of 48000. not sure why.