summaryrefslogtreecommitdiff
path: root/lib/securerandom.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/securerandom.rb')
-rw-r--r--lib/securerandom.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index cc33a08044..b1603b4ca9 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -54,8 +54,8 @@ module SecureRandom
@pid = 0 unless defined?(@pid)
pid = $$
unless @pid == pid
- now = Time.now
- ary = [now.to_i, now.nsec, @pid, pid]
+ now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
+ ary = [now, @pid, pid]
OpenSSL::Random.random_add(ary.join("").to_s, 0.0)
@pid = pid
end