Module: Benchmeth

Defined in:
lib/benchmeth.rb,
lib/benchmeth/version.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.on_benchmark_blockObject

Returns the value of attribute on_benchmark_block.



8
9
10
# File 'lib/benchmeth.rb', line 8

def on_benchmark_block
  @on_benchmark_block
end

.use_notificationsObject

Returns the value of attribute use_notifications.



8
9
10
# File 'lib/benchmeth.rb', line 8

def use_notifications
  @use_notifications
end

Class Method Details

.monotonic_timeObject



23
24
25
# File 'lib/benchmeth.rb', line 23

def self.monotonic_time
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

.on_benchmark(&block) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/benchmeth.rb', line 15

def self.on_benchmark(&block)
  if block_given?
    self.on_benchmark_block = block
  else
    self.on_benchmark_block
  end
end