Module: DiyProf::TimeHelpers
- Included in:
- Tracer
- Defined in:
- lib/diy_prof/lib/diy_prof/time_helpers.rb
Instance Method Summary collapse
-
#cpu_time ⇒ Object
These methods make use of ‘clock_gettime` method introduced in Ruby 2.1 to measure CPU time and Wall clock time.
- #wall_time ⇒ Object
Instance Method Details
#cpu_time ⇒ Object
These methods make use of ‘clock_gettime` method introduced in Ruby 2.1 to measure CPU time and Wall clock time.
5 6 7 |
# File 'lib/diy_prof/lib/diy_prof/time_helpers.rb', line 5 def cpu_time Process.clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :microsecond) end |
#wall_time ⇒ Object
9 10 11 |
# File 'lib/diy_prof/lib/diy_prof/time_helpers.rb', line 9 def wall_time Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond) end |