Sha256: 25adf44232c60c395b96b842e96254d5a5d17ed5fc1a2df49a8b5c40bd6928a9
Contents?: true
Size: 704 Bytes
Versions: 24
Compression:
Stored size: 704 Bytes
Contents
module Sqreen has_mono_time = begin Process.clock_gettime Process::CLOCK_MONOTONIC true rescue StandardError false end @has_thread_cpu_time = begin Process.clock_gettime Process::CLOCK_THREAD_CPUTIME_ID true rescue StandardError false end class << self def thread_cpu_time? @has_thread_cpu_time end end if has_mono_time def self.time Process.clock_gettime Process::CLOCK_MONOTONIC end else def self.time Time.now.to_f end end if @has_thread_cpu_time def self.thread_cpu_time Process.clock_gettime Process::CLOCK_THREAD_CPUTIME_ID end else def self.thread_cpu_time 0 end end end
Version data entries
24 entries across 24 versions & 1 rubygems