Skip to content

Commit 9a783fe

Browse files
handle :hertz unit option
1 parent 6a8fe4b commit 9a783fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/ruby/core/process.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ def self.clock_getres(id, unit=:float_second)
126126
Errno.handle if res == 0
127127
end
128128

129-
nanoseconds_to_unit(res, unit)
129+
if unit == :hertz then
130+
1.0 / nanoseconds_to_unit(res,:float_seconds)
131+
else
132+
nanoseconds_to_unit(res,unit)
133+
end
130134
end
131135

132136
def self.clock_gettime(id, unit=:float_second)

0 commit comments

Comments
 (0)