Qbasicnews.com

Full Version: counting time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
would there be a way to count how much time passed at any given moment? or do some something when a certain reallife time had been reached? thanks
Well, that's gotta be the most ambiguous question I've seen asked in years. Big Grin
me no understand...are you calling me gay? Wink
am i being to vauge with the question or not clear enough?
Quote:am·big·u·ous Audio pronunciation of "ambiguous" ( P ) Pronunciation Key (m-bgy-s)
adj.

1. Open to more than one interpretation: an ambiguous reply.
2. Doubtful or uncertain: “The theatrical status of her frequently derided but constantly revived plays remained ambiguous” (Frank Rich).
Good grief adosorken, it wasn't that ambiguous.

Try the TIME$ and TIMER functions.
Oh come on Sodapop, you understood him Tongue
Code:
t! = Timer+2 'Set the timer
Do

If Timer >= t! Then
Print "2 seconds have passed."
t! = Timer+2    'reset timer
End If
Loop while inkey$ = ""
have you ever seen that little cartoon on saturday night live called "the ambiguously gay duo" i guess that's the first thing i thought of.
z!re, i ment more like, starting a stopwatch timeing someone doing something, stoping it and then recording the time it took. kinda like that
Code:
startTime! = Timer
For a& = 0 To 100000
Next
EndTime! = Timer

Print "It took:";EndTime!-StartTime!;"seconds to complete the FOR/NEXT"
Although, if that code runs past midnight (starts pre midnight, ends after midnight) You'll get some nice errors.

TIMER is reset to 0 at midnight, and then count the seconds since midnight, with roughly millisecond accuracy (VERY rough)
sweet, thanks!