Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The "timer" function...
#1
I see (non-code) references to it everywhere, but I can't find an explanation on how it works or how to apply it. If someone could either explain it, or point me to a tutorial regarding it, I'd be much oblidged.
hey say that if you play a Windows Install CD backwards, you can hear Satanic messages. That's nothing, play it forwards and it installs Windows.
Reply
#2
It's actually real easy.

The TIMER function returns the amount of seconds passed since midnight.


Here's a simple example of how to use it.



Code:
DEFINT A-Z
SCREEN 13
DO
' You put the current TIMER amount into var WaitTime!
WaitTime! = TIMER  

'This part doesn't do anything except draw a bunch of lines.
FOR Y = 0 TO 199
Nx = (Nx + 1) MOD 160
FOR X = 0 TO 319
  Nx = (Nx + 1) MOD 160
  PSET (X, Y), Nx
NEXT
NEXT


'Now we loop in this block until TIMER is greater than WaitTime!+1
DO
LOOP UNTIL TIMER >= WaitTime! + 1

'If you want to wait 2 seconds...
'just replace the line...
'LOOP UNTIL TIMER >= WaitTime! + {2}
'without the curly braces.

LOOP
Wink
Reply
#3
**Is much oblidged**

Thanks.
hey say that if you play a Windows Install CD backwards, you can hear Satanic messages. That's nothing, play it forwards and it installs Windows.
Reply
#4
No problem. Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)