Sha256: 7ea13e156764d3c56f920230acde00d0e841f6c0f2f1b19985535605a28c7c04

Contents?: true

Size: 367 Bytes

Versions: 6

Compression:

Stored size: 367 Bytes

Contents

module Rgot
  class BenchmarkResult
    # Ruby-2.0.0 wants default value of keyword_argument
    def initialize(n: nil, t: nil)
      raise ArgumentError, "missing keyword: n" unless n
      raise ArgumentError, "missing keyword: t" unless t
      @n = n
      @t = t
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rgot-0.1.5 lib/rgot/benchmark_result.rb
rgot-0.1.4 lib/rgot/benchmark_result.rb
rgot-0.1.3 lib/rgot/benchmark_result.rb
rgot-0.1.2 lib/rgot/benchmark_result.rb
rgot-0.1.1 lib/rgot/benchmark_result.rb
rgot-0.1.0 lib/rgot/benchmark_result.rb