Skip to content

Commit

Permalink
Merge pull request #179 from KacerCZ/master
Browse files Browse the repository at this point in the history
Fixed display of duration longer than one hour
  • Loading branch information
manuelpichler committed Dec 4, 2014
2 parents 7496b0c + 3787e78 commit 1288292
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/php/PDepend/TextUI/Command.php
Expand Up @@ -248,7 +248,11 @@ public function run()
echo PHP_EOL;
}

echo PHP_EOL, 'Time: ', date('i:s', time() - $startTime);
$duration = time() - $startTime;
$hours = intval($duration / 3600);
$minutes = intval(($duration - $hours * 3600) / 60);
$seconds = $duration % 60;
echo PHP_EOL, 'Time: ', sprintf('%d:%02d:%02d', $hours, $minutes, $seconds);
if (function_exists('memory_get_peak_usage')) {
$memory = (memory_get_peak_usage(true) / (1024 * 1024));
printf('; Memory: %4.2fMb', $memory);
Expand Down

0 comments on commit 1288292

Please sign in to comment.