Sha256: 76ede78de245cb3d1661028c0cdd0c59dd814a3e7f191631d38a8ea4cbe62e28
Contents?: true
Size: 619 Bytes
Versions: 36
Compression:
Stored size: 619 Bytes
Contents
module Timber # This is an ultra-simple abstraction for timing code. This provides a little # more control around how Timber automatically processes "timers". # # @example # timer = Timber::Timer.start # # ... code to time # logger.info("My log message", my_event: {time_ms: timer}) module Timer # Abstract for starting a timber. Currently this is simply calling `Time.now`. def self.start Time.now end # Get the duration in milliseconds from the object returned in {#start} def self.duration_ms(timer) now = Time.now (now - timer) * 1000.0 end end end
Version data entries
36 entries across 36 versions & 1 rubygems