Sign in to follow this  
Followers 0
James

_GetTime()

7 posts in this topic

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

Share this post


Link to post
Share on other sites



Does it display the CPU-Time Idle time displayed in the taskmanager.. ?


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

Could be useful.

:)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

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.

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