Jump to content
Sign in to follow this  
ecstatic

Dividing $timer with sleep error!

Recommended Posts

ecstatic

Hey guys.

Heres my code.

$timer = _Timer_Init()
    Do
        Tooltip("Sleeping for " & $timer/1000 &" Seconds.", 0, 0, "D2AI")
        Sleep(10)
    Until _Timer_Diff($timer) >= 180000; 3 mintues.

If it is in miliseconds, and you divide by 1000, shouldnt it show a solid not decimal number.

>.<

Edited by ecstatic

Share this post


Link to post
Share on other sites
Hawkwing

Maybe it's because your last line has it go until $timer is greater than 60 seconds. Shouldn't it be less than. I haven't seen many timers that count upward.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites
ecstatic

Maybe it's because your last line has it go until $timer is greater than 60 seconds. Shouldn't it be less than. I haven't seen many timers that count upward.

Well, i have timer_init start in another function, because i need it to be X many seconds before it remakes a game to avoid a restriction

Share this post


Link to post
Share on other sites
martin

Hey guys.

Heres my code.

$timer = _Timer_Init()
     Do
         Tooltip("Sleeping for " & $timer/1000 &" Seconds.", 0, 0, "D2AI")
         Sleep(10)
     Until _Timer_Diff($timer) >= 180000; 3 mintues.

If it is in miliseconds, and you divide by 1000, shouldnt it show a solid not decimal number.

>.<

Supposing that TimerInit actually returns a value that is in milliseconds (which it doesn't despite what the help says), why would dividing it by 1000 give an integer if that is what you mean by a solid number? Say the value were 123456 mS then dividing that by 1000 would give 123.456.

The value in mS is only returned by TimerDiff.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
ecstatic

Supposing that TimerInit actually returns a value that is in milliseconds (which it doesn't despite what the help says), why would dividing it by 1000 give an integer if that is what you mean by a solid number? Say the value were 123456 mS then dividing that by 1000 would give 123.456.

The value in mS is only returned by TimerDiff.

<-- novice.

Waaahhh? In english?

Because 1000 miliseconds divided by 1000 is 1, meaning 1 second, meaning the sleep timer im displaying i dont want the users to have to do the math of finding how many seconds until the script continues instead i figured. Oh hey, why dont i display it as seconds.

Would i be better off rounding it?

Edited by ecstatic

Share this post


Link to post
Share on other sites
Inverted

Would i be better off rounding it?

Of course !

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.