module TimeFormat
Overview
Available methods (for convenience):
Extended Modules
Defined in:
time_format.crInstance Method Summary
-
#auto(time : Float | Time::Span, short = true) : String
Returns time in human readable format based on how big it is
-
#m(time, round = 2)
Returns time in minutes in short human readable format
-
#mcs(time : Float | Time::Span)
ditto
-
#microseconds(time : Float | Time::Span) : String
Returns time in microseconds in human readable format
-
#milliseconds(time : Float | Time::Span, round : Int32 = 3) : String
Returns time in milliseconds in human readable format
-
#minutes(time : Float | Time::Span, round : Int32 = 2) : String
Returns time in minutes in human readable format
-
#ms(time : Float | Time::Span, round : Int32 = 3)
Returns time in milliseconds in short human readable format
-
#s(time, round = 3)
Returns time in seconds in short human readable format
-
#seconds(time, round = 3) : String
Returns time in seconds in human readable format
-
#μs(time : Float | Time::Span)
Returns time in microseconds in short human readable format
Instance Method Detail
Returns time in human readable format based on how big it is
TimeFormat.auto(1.minute, false) # => 1 minute
TimeFormat.auto(1.milliseconds / 2) # => 500μs
Returns time in minutes in short human readable format
TimeFormat.m(5.minutes + 36.seconds + 175.milliseconds) # => 5.6m
Returns time in microseconds in human readable format
TimeFormat.microseconds(5.minutes + 36.seconds + 175.milliseconds) # => 336175000 microseconds
Returns time in milliseconds in human readable format
TimeFormat.milliseconds(5.minutes + 36.seconds + 175.milliseconds) # => 336175.0 milliseconds
Returns time in minutes in human readable format
TimeFormat.minutes(5.minutes + 36.seconds + 175.milliseconds) # => 5.6 minutes
Returns time in milliseconds in short human readable format
TimeFormat.ms(5.minutes + 36.seconds + 175.milliseconds) # => 336175.0ms
Returns time in seconds in short human readable format
TimeFormat.s(5.minutes + 36.seconds + 175.milliseconds) # => 336.175s
Returns time in seconds in human readable format
TimeFormat.seconds(5.minutes + 36.seconds + 175.milliseconds) # => 336.175 seconds
Returns time in microseconds in short human readable format
TimeFormat.μs(5.minutes + 36.seconds + 175.milliseconds) # => 336175000μs