# Dividing \$timer with sleep error!

## Recommended Posts

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 on other sites

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 on other sites

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 on other sites

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 on other sites

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 on other sites

Would i be better off rounding it?

Of course !

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...