Class: Rgot::BenchmarkResult
- Inherits:
-
Object
- Object
- Rgot::BenchmarkResult
- Defined in:
- lib/rgot/benchmark_result.rb
Instance Attribute Summary collapse
-
#n ⇒ Object
readonly
Returns the value of attribute n.
-
#t ⇒ Object
readonly
Returns the value of attribute t.
Instance Method Summary collapse
-
#initialize(n:, t:) ⇒ BenchmarkResult
constructor
A new instance of BenchmarkResult.
- #to_s ⇒ Object
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
#n ⇒ Object (readonly)
Returns the value of attribute n.
6 7 8 |
# File 'lib/rgot/benchmark_result.rb', line 6 def n @n end |
#t ⇒ Object (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_s ⇒ Object
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 |