Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/float.rb

Instance Method Summary collapse

Instance Method Details

#to_human_timeObject



2
3
4
5
6
7
8
# File 'lib/extensions/float.rb', line 2

def to_human_time
  case self
    when 0..1 then "#{(self * 1000).floor} msecs"
    when 1..2 then "1 sec"
    else "#{floor} secs"
  end
end