Skip to content

Commit 7e88d72

Browse files
committed
[Truffle] Have a decent path for Time#to_f since that seems used much in practice.
* Time#-(Time) should be used instead. * Or even better Process.clock_gettime(Process::CLOCK_MONOTONIC).
1 parent 470acf2 commit 7e88d72

File tree

1 file changed

+1
-1
lines changed
  • truffle/src/main/ruby/core/rubinius/common

1 file changed

+1
-1
lines changed

truffle/src/main/ruby/core/rubinius/common/time.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def to_r
173173
end
174174

175175
def to_f
176-
to_r.to_f
176+
seconds + nsec * 0.000000001 # Truffle: optimized
177177
end
178178

179179
def +(other)

0 commit comments

Comments
 (0)