Sha256: 9a737a8fb3f6152dfe9598240c6ee7cc21b2ab678a57b896f7c3708f745b2620
Contents?: true
Size: 666 Bytes
Versions: 5
Compression:
Stored size: 666 Bytes
Contents
# frozen_string_literal: true module SidekiqUniqueJobs module Script # Handles timing> of things # # @author Mikael Henriksson <mikael@mhenrixon.com> module Timing module_function # # Used for timing method calls # # # @return [yield return, Float] # def timed start_time = now [yield, now - start_time] end # # Returns a float representation of the current time. # Either from Process or Time # # # @return [Float] # def now (Process.clock_gettime(Process::CLOCK_MONOTONIC) * 1000).to_i end end end end
Version data entries
5 entries across 5 versions & 1 rubygems