Module: Benchable
- Defined in:
- lib/benchable.rb,
lib/benchable/version.rb,
lib/benchable/benchmark.rb
Defined Under Namespace
Classes: Benchmark, Error
Constant Summary
collapse
- VERSION =
'0.2.0'
Class Method Summary
collapse
Class Method Details
.bench(type = :bm, **options, &block) ⇒ Object
15
16
17
|
# File 'lib/benchable.rb', line 15
def self.bench(type = :bm, **options, &block)
build(type, **options, &block).run
end
|
.build(type = :bm, **options, &block) ⇒ Object
9
10
11
12
13
|
# File 'lib/benchable.rb', line 9
def self.build(type = :bm, **options, &block)
bench_class = Class.new(Benchmark, &block)
bench_class.new(type, **options)
end
|