Jump to content

Milliseconds???


Recommended Posts

This might help in the future:

60 minutes     60 seconds     1000 millisecs
1 hour  x  ----------  x  ----------  x  --------------   =  3600000 millisecs
               hour          minute          second

Edit: Missed a zero

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

3600000

Thats what I thought. Apparently I must not understand the TimerStart than.

I want a 'do until' to loop until the timer hits an hour "3,600,000" but it wouldn't work. So I put a msgbox in the loop to display the Timer info every 1 second. the message box is listing an item that is about 44 billion, What am I not understanding here? what shold I list the until $Timer = "HOUR"

do
$Time = TimerStart()
sleep(1000)
msgbox(0, "Timer", "It's been " & $Time)
until $Time = 3600000

Mike

Edited by MikeOsdx
Link to comment
Share on other sites

Look closely at the docs for TimerStop--it's somewhat strange.

$start = TimerStart()
Do
  sleep(100)
Until TimerStop($start) > 3600000
That works,

it is weird having to put the TimerStop in there but I guess I will just have to blindly accept that.

thanks,

Mike

Link to comment
Share on other sites

That works,

it is weird having to put the TimerStop in there but I guess I will just have to blindly accept that.

If it helps you understand at all, when you call TimerStart it does not start at 0. Because of this, you need to call call TimerStop and referance the number you got back from TimerStart. This will then return the difference in time between the start time, and the current system time.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

If it helps you understand at all, when you call TimerStart it does not start at 0. Because of this, you need to call call TimerStop and referance the number you got back from TimerStart. This will then return the difference in time between the start time, and the current system time. Ahh, That makes perfect sence now. Thanks... That explaines the crazy numbers I was getting when I was sending the timer output to a mesagebox.

Mike

Link to comment
Share on other sites

Guest Guest_Lor20

I did some testing - the timerstart function moves on for every cpu "cycle" (no idea what the correct terminus is here - so soince i got a 3 GHz Cpu that increases by 3,000,000,000 every second. The number is actually the number of cycles your CPU has gone through since you switched it on the last time. - so if you divide it by ur cppu frequency you get your uptime in seconds.

Lor20

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...