Class: Rgot::BenchmarkResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rgot/benchmark_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n:, t:) ⇒ BenchmarkResult

Returns a new instance of BenchmarkResult.



9
10
11
12
# File 'lib/rgot/benchmark_result.rb', line 9

def initialize(n:, t:)
  @n = n
  @t = t
end

Instance Attribute Details

#nObject (readonly)

Returns the value of attribute n.



6
7
8
# File 'lib/rgot/benchmark_result.rb', line 6

def n
  @n
end

#tObject (readonly)

Returns the value of attribute t.



7
8
9
# File 'lib/rgot/benchmark_result.rb', line 7

def t
  @t
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/rgot/benchmark_result.rb', line 14

def to_s
  sprintf("%d\t%d ns/op", @n, @t / @n * 1_000_000_000)
end