Sha256: f462bca9100a9e1f57723a01387f1cf453389e4d933fd565acc92268e18acb12
Contents?: true
Size: 369 Bytes
Versions: 1
Compression:
Stored size: 369 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%.3f ns/op", @n, @t / @n * 1_000_000_000) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rgot-0.0.5 | lib/rgot/benchmark_result.rb |