Permalink
Browse files

Improved the elapsed time reporting in the Rake task

Closes #480
  • Loading branch information...
1 parent 027ad53 commit 5d6b0cd90cf3f90f84b68dff705b775d13727d6b @karmi karmi committed with Oct 16, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/tire/tasks.rb
View
8 lib/tire/tasks.rb
@@ -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 5d6b0cd

Please sign in to comment.