hatchetman Posted December 8, 2005 Share Posted December 8, 2005 Hello, I am having trouble using the _TicksToTime function I can't seem to get the variables for the hours, mins, and seconds back from the function. Please help me understand what I am doing wrong. I have included the code snippet that isn't working From AutoIt Help: #Include <date.au3> _TicksToTime ( $iTicks, $iHours, $iMins, $iSecs ) Parameters $iTicks Tick amount. $iHours Variable to store the hours. $iMins Variable to store the minutes. $iSecs Variable to store the seconds. My Code: #Include <date.au3> Dim $begin, $diff, $hours, $mins, $seconds $begin = TimerInit() sleep(5000) $diff = TimerDiff($begin) _TicksToTime($diff,$hours,$mins,$seconds) MsgBox(0,"Elapsed Time", $hours & "hours " & $mins & "mins " & $seconds & "secs") Link to comment Share on other sites More sharing options...
hatchetman Posted December 8, 2005 Author Share Posted December 8, 2005 I needed to round the ticks to the nearest integer or the funciton won't work... my bad! #Include <date.au3> Dim $begin, $diff, $hours, $mins, $seconds $begin = TimerInit() sleep(5000) $diff = TimerDiff($begin) _TicksToTime(Round($diff,0),$hours,$mins,$seconds) MsgBox(0,"Elapsed Time", $hours & "hours " & $mins & "mins " & $seconds & "secs") Link to comment Share on other sites More sharing options...
SandelPerieanu Posted December 8, 2005 Share Posted December 8, 2005 $diff =Int( TimerDiff($begin)) 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