BruceCopperField Posted January 16, 2008 Share Posted January 16, 2008 The result of TImerInit() is supposed to be millisecond. So i guess it is possible to add/minus value to it. But is this property guaranteed by the development team? Would it be changed in the future to some internal format? Link to comment Share on other sites More sharing options...
weaponx Posted January 16, 2008 Share Posted January 16, 2008 (edited) TimerInit() returns the number of milliseconds from last system boot. TimerDiff() does the same but substracts the previous amount. Voila! A reliable metric to measure time difference. I don't see why this would change. Heres an example: $milliseconds = TimerDiff(0) $years = Int($milliseconds / 31536000000) $remainMS = Mod($milliseconds, 31536000000) $days = Int($remainMS / 86400000) $remainMS = Mod($milliseconds, 86400000) $hours = Int($remainMS / 3600000) $remainMS = Mod($milliseconds, 3600000) $minutes = Int($remainMS / 60000) $remainMS = Mod($milliseconds, 60000) $seconds = Int($remainMS / 1000) $remainMS = Mod($milliseconds, 1000) MsgBox(0,"Time since last boot","Years: " & $years & @CRLF & "Days: " & $days & @CRLF & "Hours: " & $hours & @CRLF & "Minutes: " & $minutes & @CRLF & "Seconds: " & $seconds & @CRLF & "Milliseconds: " & Int($remainMS)) Edited January 16, 2008 by weaponx 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