I'm using this timer function for my game, it converts a number of milliseconds into a 00:00:00 format.
sync on
sync rate 0
cls
time_end=timer()+seconds(10)
do
cls
time_remaining=time_end-timer()
print time$(time_remaining)
if time_Remaining<=0 then print "Time's Up!"
sync
loop
function seconds(ms)
s=ms*1000
endfunction s
function minutes(ms)
m=ms*1000*60
endfunction m
function time$(t)
`this is a clock, give it a time in ms and it will return the time in the form of min : sec : millisec
`if the time is greater than 0
if t>0
t=t/10.0
mseconds0=t
seconds0=0
minutes0=0
if t>=100
seconds0=(t)/100
while mseconds0>99
dec mseconds0,100
endwhile
endif
if seconds0>=60
minutes0=(seconds0)/60
while seconds0>59
dec seconds0,60
endwhile
endif
s$=""
`if single digit, add a zero
if minutes0<10 then s$=s$+"0"
s$=s$+str$(minutes0)+":"
`if single digit, add a zero
if seconds0<10 then s$=s$+"0"
s$=s$+str$(seconds0)+":"
`if single digit, add a zero
if mseconds0<10 then s$=s$+"0"
s$=s$+str$(mseconds0)
`else return 00:00:00
else
s$="00:00:00"
endif
endfunction s$
-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.