class Airbrake::Benchmark
@api public
@since v4.2.4
Benchmark benchmarks Ruby code.
def self.measure
- Yieldreturn: -
def self.measure benchmark = new yield benchmark.stop benchmark.duration end
def initialize
- Since: - v4.3.0
def initialize @start = MonotonicTime.time_in_ms @duration = 0.0 end
def stop
-
(Boolean)
- true for the first invocation, false in all other cases
Other tags:
- Since: - v4.3.0
def stop return false if @duration > 0.0 @duration = MonotonicTime.time_in_ms - @start true end