James Posted June 20, 2008 Share 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 Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted June 20, 2008 Share Posted June 20, 2008 Does it display the CPU-Time Idle time displayed in the taskmanager.. ? Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
James Posted June 20, 2008 Author Share 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 Link to comment Share on other sites More sharing options...
monoceres Posted June 20, 2008 Share Posted June 20, 2008 Could be useful. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
James Posted June 20, 2008 Author Share Posted June 20, 2008 Thanks monoceres. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Malkey Posted June 20, 2008 Share 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. Link to comment Share on other sites More sharing options...
James Posted June 20, 2008 Author Share 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 Link to comment Share on other sites More sharing options...
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