Posted: Sat Dec 18, 2004 1:38 pm Post subject: How to insert a timer (seconds)
Hello, I would like to know if anyone here knows how to add a timer in a loop in seconds. Thanks in advance!
Sponsor Sponsor
Cervantes
Posted: Sat Dec 18, 2004 1:45 pm Post subject: (No subject)
There sure is a way to do it Time.Elapsed.
code:
loop
locate (1, 1)
put Time.Elapsed / 1000 : 6 : 3, " seconds have passed since this program began."
if Time.Elapsed / 1000 > 10 then
locate (2, 1)
put "That's a long time. Hop to it!"
end if
end loop
Note that Time.Elapsed returns a value in milliseconds. Thus, divide that value by 1000 to get a value in seconds.
hq78
Posted: Sat Dec 18, 2004 5:14 pm Post subject: (No subject)
thank you very much!
zomg
Posted: Sat Dec 18, 2004 11:28 pm Post subject: (No subject)
doesnt time.elapsed measure cpu time not actual time?
Neo
Posted: Sat Dec 18, 2004 11:48 pm Post subject: (No subject)
shadow master wrote:
doesnt time.elapsed measure cpu time not actual time?
Im pretty sure its the actual length of time since starting the program.
Cervantes
Posted: Sun Dec 19, 2004 8:25 am Post subject: (No subject)
shadow master wrote:
doesnt time.elapsed measure cpu time not actual time?
ssshh....
Mazer
Posted: Sun Dec 19, 2004 9:34 am Post subject: (No subject)
shadow master wrote:
doesnt time.elapsed measure cpu time not actual time?
Turing Reference wrote:
The Time.Elapsed function returns the amount of time since a program (process) started running. The number of milliseconds since the program started running is returned.
Well. Nope. It's just that it's not always accurate.
Cervantes
Posted: Sun Dec 19, 2004 9:42 am Post subject: (No subject)