Sha256: 11397d4d91085799ccd126744fa6d4b4c63c38a60643123eda5d0efa6d3f4b8b

Contents?: true

Size: 438 Bytes

Versions: 19

Compression:

Stored size: 438 Bytes

Contents

#!/usr/bin/env ruby

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2017

require "bundler"
Bundler.require(:default)

require "benchmark"

# Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)

Benchmark.bm do |x|
  x.report("Time.now:     ") { 1_000_000.times { (Time.now.to_f * 1000).floor } }
  x.report("get_clocktime:") { 1_000_000.times { Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) } }
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
instana-1.199.6 benchmarks/time_processing.rb
instana-1.199.5 benchmarks/time_processing.rb
instana-1.199.4 benchmarks/time_processing.rb
instana-1.199.3 benchmarks/time_processing.rb
instana-1.199.2 benchmarks/time_processing.rb
instana-1.199.1 benchmarks/time_processing.rb
instana-1.199.0 benchmarks/time_processing.rb
instana-1.198.0 benchmarks/time_processing.rb
instana-1.198.0.pre1 benchmarks/time_processing.rb
instana-1.197.0 benchmarks/time_processing.rb
instana-1.197.0.pre2 benchmarks/time_processing.rb
instana-1.197.0.pre1 benchmarks/time_processing.rb
instana-1.195.4 benchmarks/time_processing.rb
instana-1.195.3 benchmarks/time_processing.rb
instana-1.195.2 benchmarks/time_processing.rb
instana-1.195.1 benchmarks/time_processing.rb
instana-1.195.0 benchmarks/time_processing.rb
instana-1.193.6 benchmarks/time_processing.rb
instana-1.193.5 benchmarks/time_processing.rb