From QB64 Wiki
Revision as of 04:24, 28 August 2009 by (talk)
Jump to navigation Jump to search

TIMER returns the number of seconds past the previous midnite. It can return single values down to about .05 seconds accurately. Values range from 0 at midnite to 86399.

Example 1: t! = TIMER + 1: DO: LOOP UNTIL TIMER > t! 'one second delay

Warning: TIMER value comparison ranges cannot exceed 86399! If a comparison value is used it must fall within that range!

Example 2: Midnite adjustment:

SUB Delay (dlay!)

start! = TIMER

DO WHILE start! + dlay! >= TIMER

IF start! > TIMER THEN start! = start! - 86400