Class: Time
- Includes:
- Lite::Ruby::DateHelper, Lite::Ruby::TimeHelper
- Defined in:
- lib/lite/ruby/time.rb
Constant Summary
Constants included from Lite::Ruby::TimeHelper
Lite::Ruby::TimeHelper::TIME_STAMPS, Lite::Ruby::TimeHelper::TIME_UNITS
Constants included from Lite::Ruby::DateHelper
Lite::Ruby::DateHelper::DATE_STAMPS, Lite::Ruby::DateHelper::DATE_UNITS
Class Method Summary collapse
Methods included from Lite::Ruby::DateHelper
Class Method Details
.elapse(verbose: false) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/lite/ruby/time.rb', line 11 def elapse(verbose: false) started_at = monotonic yield ended_at = monotonic runtime = ended_at - started_at return runtime unless verbose { started_at: started_at, ended_at: ended_at, runtime: runtime } end |
.monotonic ⇒ Object
21 22 23 |
# File 'lib/lite/ruby/time.rb', line 21 def monotonic Process.clock_gettime(Process::CLOCK_MONOTONIC) end |