File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
java/org/truffleruby/core Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ public abstract class ProcessNodes {
27
27
@ Primitive (name = "process_time_nanotime" )
28
28
public abstract static class ProcessTimeNanoTimeNode extends PrimitiveArrayArgumentsNode {
29
29
30
- @ TruffleBoundary
31
30
@ Specialization
32
31
protected long nanoTime () {
33
32
return System .nanoTime ();
Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ def self.clock_gettime(id, unit=:float_second)
156
156
end
157
157
158
158
case id
159
- when CLOCK_REALTIME
160
- time = Primitive . process_time_instant
161
159
when CLOCK_MONOTONIC
162
160
time = Primitive . process_time_nanotime
161
+ when CLOCK_REALTIME
162
+ time = Primitive . process_time_instant
163
163
else
164
164
time = Truffle ::POSIX . truffleposix_clock_gettime ( id )
165
165
Errno . handle if time == 0
@@ -170,20 +170,20 @@ def self.clock_gettime(id, unit=:float_second)
170
170
171
171
def self . nanoseconds_to_unit ( nanoseconds , unit )
172
172
case unit
173
- when :nanosecond
174
- nanoseconds
175
- when :microsecond
176
- nanoseconds / 1_000
177
- when :millisecond
178
- nanoseconds / 1_000_000
179
- when :second
180
- nanoseconds / 1_000_000_000
173
+ when :float_second , nil
174
+ nanoseconds / 1e9
181
175
when :float_microsecond
182
176
nanoseconds / 1e3
183
177
when :float_millisecond
184
178
nanoseconds / 1e6
185
- when :float_second , nil
186
- nanoseconds / 1e9
179
+ when :second
180
+ nanoseconds / 1_000_000_000
181
+ when :millisecond
182
+ nanoseconds / 1_000_000
183
+ when :microsecond
184
+ nanoseconds / 1_000
185
+ when :nanosecond
186
+ nanoseconds
187
187
else
188
188
raise ArgumentError , "unexpected unit: #{ unit } "
189
189
end
You can’t perform that action at this time.
0 commit comments