We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f3c668 commit 10daf35Copy full SHA for 10daf35
src/main/ruby/core/process.rb
@@ -116,11 +116,17 @@ def self.time
116
end
117
118
def self.clock_getres(id, unit=:float_second)
119
- case id = normalize_clock_id(id)
120
- when CLOCK_REALTIME
121
- res = 1_000_000
122
- when CLOCK_MONOTONIC
123
- res = 1
+ res = case id
+ when :GETTIMEOFDAY_BASED_CLOCK_REALTIME,
+ :GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID,
+ :CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
+ 1_000
124
+ when :TIME_BASED_CLOCK_REALTIME
125
+ 1_000_000_000
126
+ when :MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC,
127
+ :TIMES_BASED_CLOCK_MONOTONIC
128
+ 1
129
+ when :TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
130
else
131
res = Truffle::POSIX.truffleposix_clock_getres(id)
132
Errno.handle if res == 0
0 commit comments