James Posted June 20, 2008 Posted June 20, 2008 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] EndFuncYeah, it's nothing big nor majorly important however some system administrators might find it useful.James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Emiel Wieldraaijer Posted June 20, 2008 Posted June 20, 2008 Does it display the CPU-Time Idle time displayed in the taskmanager.. ? Best regards,Emiel Wieldraaijer
James Posted June 20, 2008 Author Posted June 20, 2008 No, this function returns the time that windows has been on for since startup time (in milliseconds) Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
monoceres Posted June 20, 2008 Posted June 20, 2008 Could be useful. Broken link? PM me and I'll send you the file!
James Posted June 20, 2008 Author Posted June 20, 2008 Thanks monoceres. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Malkey Posted June 20, 2008 Posted June 20, 2008 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.
James Posted June 20, 2008 Author Posted June 20, 2008 Hi Malkey, I was actually just adding to it now to convert it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now