Jump to content

Recommended Posts

Posted

Hi all,

While I was just trying to achieve better Sleep() results as ludocus pointed out the sleep time is incorrect, I found timeGetTime():

Func _GetTime()
    $Dll = DllCall("WinMM.dll", "long", "timeGetTime")
    Return $Dll[0]
EndFunc

Yeah, it's nothing big nor majorly important however some system administrators might find it useful.

James

Posted

I'm probably not the only person to do something like this.

I had to see if it worked.

Milliseconds are not my forte.

MsgBox(0,"", HrsDec2HMS(_GetTime()/(1000*3600)))
; http://www.autoitscript.com/forum/index.php?s=&showtopic=74145&view=findpost&p=539247
Func _GetTime()
    $Dll = DllCall("WinMM.dll", "long", "timeGetTime")
    Return $Dll[0]
EndFunc

Func HrsDec2HMS($DecHrs)
    Local $hr, $min, $Sec
    $hr = int($DecHrs)
    $min = Int(($DecHrs - $hr)*60)
    $sec = ($DecHrs*3600) -(($hr*3600)+($min*60))       
    Return   $hr & "hr " & $min & "min " & Round($sec,3) & "sec"
EndFunc

The result I got seems about right.

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
×
×
  • Create New...