Module: Hitimes

Defined in:
lib/hitimes.rb,
lib/hitimes/paths.rb,
lib/hitimes/stats.rb,
lib/hitimes/metric.rb,
lib/hitimes/version.rb,
lib/hitimes/timed_metric.rb,
lib/hitimes/value_metric.rb,
lib/hitimes/mutexed_stats.rb,
lib/hitimes/timed_value_metric.rb,
ext/hitimes/c/hitimes.c,
ext/hitimes/c/hitimes_stats.c,
ext/hitimes/c/hitimes_interval.c

Overview

– Copyright © 2008, 2009 Jeremy Hinegardner All rights reserved. See LICENSE and/or COPYING for details. ++

Defined Under Namespace

Modules: Paths Classes: Error, Interval, Metric, MutexedStats, Stats, TimedMetric, TimedValueMetric, ValueMetric

Constant Summary collapse

VERSION =
"1.3.0"
INSTANT_CONVERSION_FACTOR =
DBL2NUM( HITIMES_INSTANT_CONVERSION_FACTOR )

Class Method Summary collapse

Class Method Details

.measure(&block) ⇒ Object

Hitimes.measure { } -> Float

Times the execution of the block, returning the number of seconds it took



22
23
24
# File 'lib/hitimes.rb', line 22

def self.measure(&block)
  Hitimes::Interval.measure(&block)
end

.raw_instantInteger

Return the raw instant value from the operating system

Returns:

  • (Integer)


15
16
17
18
19
20
# File 'ext/hitimes/c/hitimes.c', line 15

VALUE hitimes_instant_raw( )
{
    unsigned long long i = (unsigned long long)hitimes_get_current_instant( );

    return ULL2NUM(i);
}