Quote: "IanM's Hitimer() function starts at zero"
Recent change, simply to ensure that the chances of the timer overflowing are minimised as much as possible ... certainly for a period longer than any version of windows has ever or will ever run for
However, it selects zero time as the start time of the program, which isn't necessarily when you want to start timing from, hence Van's and my advice above.
Another method would be to use a timer from my plug-ins to increment a counter once per second - if you separately increment variables for seconds, hours, minutes and days then you can avoid the maths for calculating those separate values:
sync on
sync rate 0
backdrop on
make ticker 1, 1000
global tick_second as integer
global tick_minute as integer
global tick_hour as integer
global tick_day as integer
global tick_time as string
do
while ticker(1)
UpdateClock()
endwhile
text 0, 0, tick_time
sync
loop
function UpdateClock()
inc tick_second
if tick_second > 59
tick_second = 0
inc tick_minute
if tick_minute > 59
tick_minute = 0
inc tick_hour
if tick_hour > 23
tick_hour = 0
inc tick_day
endif
endif
endif
tick_time = str$(tick_day) + " "
tick_time = tick_time + padleft$(str$(tick_hour), "0", 2) + ":"
tick_time = tick_time + padleft$(str$(tick_minute), "0", 2) + ":"
tick_time = tick_time + padleft$(str$(tick_second), "0", 2)
endfunction
It's also a little more efficient too - the clock is only updated when it needs to be and you're not recalculating every frame either.