Sign in to follow this  
Followers 0
BigDaddyO

Milliseconds???

11 posts in this topic

Alright,

I am trying to use the timer start and my brain hurts... Could anyone tell me how many milliseconds in an hour.

Thanks,

Mike


Share this post


Link to post
Share on other sites



3600000

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

You can make a script sleep for an hour this way:

Sleep(60 * 60 * 1000)

Share this post


Link to post
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


Share this post


Link to post
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.

Share this post


Link to post
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


Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0