Sha256: 06fe1f4ba297b8e7156ba574c88aecf505d13bbec365bf5d9ebae79112757ecd
Contents?: true
Size: 886 Bytes
Versions: 39
Compression:
Stored size: 886 Bytes
Contents
# typed: ignore # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html # TODO: move to Sqreen::Time 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
39 entries across 39 versions & 1 rubygems