Module: Kubes::Util::Time

Included in:
Docker::Strategy::Utils
Defined in:
lib/kubes/util/time.rb

Instance Method Summary collapse

Instance Method Details

#pretty_time(total_seconds) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/kubes/util/time.rb', line 4

def pretty_time(total_seconds)
  minutes = (total_seconds / 60) % 60
  seconds = total_seconds % 60
  if total_seconds < 60
    "#{seconds.to_i}s"
  else
    "#{minutes.to_i}m #{seconds.to_i}s"
  end
end