Permalink
Browse files

Improved the elapsed time reporting in the Rake task

Closes #480
  • Loading branch information...
1 parent 879a048 commit 6fef4877b61e674950b31c861290cb42da41472d @karmi committed Oct 16, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/tire/tasks.rb
View
@@ -24,13 +24,13 @@ def elapsed_to_human(elapsed)
case elapsed
when 0..59
- "#{sprintf("%1.5f", elapsed)} seconds"
+ "#{sprintf("%1.2f", elapsed)} seconds"
when 60..hour-1
- "#{elapsed/60} minutes and #{elapsed % 60} seconds"
+ "#{(elapsed/60).floor} minutes and #{(elapsed % 60).floor} seconds"
when hour..day
- "#{elapsed/hour} hours and #{elapsed % hour} minutes"
+ "#{(elapsed/hour).floor} hours and #{(elapsed/60 % hour).floor} minutes"
else
- "#{elapsed/hour} hours"
+ "#{(elapsed/hour).round} hours"
end
end

0 comments on commit 6fef487

Please sign in to comment.