I have used the following code in the past to create hrs:mns:secs format
This is from my older stuff and contains some excessive lines of code. Laziness has kept me away from optimizing it :). It doesn't conform to strict.
$runTime = ConvertSeconds(TOTAL_SECONDS_HERE); print "$runTime\n"; sub ConvertSeconds($) { $hours = $minutes = $seconds = 0; ($minutes, undef) = split (/\./, "@_" / 60); $seconds = "@_" - ($minutes * 60); if ($minutes >= 60) { ($hours, undef) = split (/\./, $minutes / 60); $minutes = $minutes - ($hours * 60); } $minutes = "0$minutes" if (length($minutes) == 1); $seconds = "0$seconds" if (length($seconds) == 1); if ($hours) { $result = "$hours:$minutes:$seconds"; } else { $result = "$minutes:$seconds"; } return $result; }
Hope this helps.
In reply to Re: How to format Benchmark results in hours?
by FitTrend
in thread How to format Benchmark results in hours?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |