module Hitimes
The top level module containing the contents of the hitimes library
use the library with:
require 'hitimes'
Hitimes
Constants and module methods
Copyright © 2008 Jeremy Hinegardner All rights reserved. See LICENSE and/or COPYING for details.
Constants
- MutexedStats
-
MutexedStats
is the start of a threadsafeStats
class. Currently, on MRI Ruby theStats
object is already threadsafe, so there is no need to useMutexedStats
. - VERSION
Public Class Methods
Source
# File lib/hitimes/instant.rb, line 29 def clock_name case CLOCK_ID when Symbol CLOCK_ID.to_s else const = Process.constants.grep(/CLOCK/).find do |id| Process.const_get(id) == CLOCK_ID end "Process::#{const}" end end
The human readable clock name of the CLOCK_ID
as a string
Returns¶ ↑
Returns the clock name as a String
Source
# File lib/hitimes.rb, line 24 def self.measure(&block) Hitimes::Interval.measure(&block) end
Hitimes.measure
{ } -> Float
Times the execution of the block, returning the number of seconds it took
Source
Public
↑ topConstants
- CLOCK_ID
-
The clock_id to use in Process.clock_gettime
Private Instance Methods
Source
Internal
↑ topConstants
- NANOSECONDS_PER_SECOND
-
The fraction of second of a nanosecond
Private Instance Methods
Source
# File lib/hitimes/instant.rb, line 29 def clock_name case CLOCK_ID when Symbol CLOCK_ID.to_s else const = Process.constants.grep(/CLOCK/).find do |id| Process.const_get(id) == CLOCK_ID end "Process::#{const}" end end
The human readable clock name of the CLOCK_ID
as a string
Returns¶ ↑
Returns the clock name as a String