Sha256: 28cf65872a70e01514c4796064114037424d45230e0c3249d19eeb5ac23190ba

Contents?: true

Size: 357 Bytes

Versions: 2

Compression:

Stored size: 357 Bytes

Contents

module Asynk
  class Benchmark
    class << self

      def measure_around(&block)
        start_time = Time.now.to_f
        block.call
        ((Time.now.to_f - start_time)*1000).round(2)
      end

      def start
        Time.now.to_f
      end

      def end(start_time)
        ((Time.now.to_f - start_time)*1000).round(2)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asynk-0.0.2 lib/asynk/benchmark.rb
asynk-0.0.1 lib/asynk/benchmark.rb