summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/process')
-rw-r--r--spec/ruby/core/process/times_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/process/times_spec.rb b/spec/ruby/core/process/times_spec.rb
index d2610f6415..9e16c36b7a 100644
--- a/spec/ruby/core/process/times_spec.rb
+++ b/spec/ruby/core/process/times_spec.rb
@@ -26,8 +26,8 @@ describe "Process.times" do
# If getrusage has precision beyond milliseconds, there will be
# very likely at least one non-zero microsecond results when
# repeating enough.
- time = Process.clock_gettime(:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID)
- not ('%.6f' % time).end_with?('000')
+ time = Process.clock_gettime(:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID, :nanosecond)
+ not (time % 1_000_000) == 0
end
rescue Errno::EINVAL
false