MCPcopy Create free account
hub / github.com/apache/arrow / format_time_interval

Method format_time_interval

dev/release/binary-task.rb:182–198  ·  view source on GitHub ↗
(interval)

Source from the content-addressed store, hash-verified

180 end
181
182 def format_time_interval(interval)
183 if interval < 60
184 "00:00:%02d" % interval
185 elsif interval < (60 * 60)
186 minute, second = interval.divmod(60)
187 "00:%02d:%02d" % [minute, second]
188 elsif interval < (60 * 60 * 24)
189 minute, second = interval.divmod(60)
190 hour, minute = minute.divmod(60)
191 "%02d:%02d:%02d" % [hour, minute, second]
192 else
193 minute, second = interval.divmod(60)
194 hour, minute = minute.divmod(60)
195 day, hour = hour.divmod(24)
196 "%dd %02d:%02d:%02d" % [day, hour, minute, second]
197 end
198 end
199
200 def format_throughput(throughput)
201 "%2d/s" % throughput

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected