Sha256: 178bc0f4c9b2ebe9f38d6d43bc4064680d55939db7347ecd12eee0e3c99bbe6e
Contents?: true
Size: 768 Bytes
Versions: 32
Compression:
Stored size: 768 Bytes
Contents
# frozen_string_literal: true require "benchmark/ips" Benchmark.ips do |bench| bench.report("Process.clock_gettime in milliseconds (int)") do Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) end bench.report("Process.clock_gettime in milliseconds (float)") do Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) end bench.report("Process.clock_gettime in seconds (float), multiplied by 1000") do 1000 * Process.clock_gettime(Process::CLOCK_MONOTONIC) end bench.report("Process.clock_gettime in seconds (float), multiplied by 1000.0") do 1000.0 * Process.clock_gettime(Process::CLOCK_MONOTONIC) end bench.report("Time.now, multiplied by 1000") do 1000 * Time.now.to_f end bench.compare! end
Version data entries
32 entries across 32 versions & 1 rubygems