зеркало из https://github.com/github/ruby.git
Check by integer modulo instead of float string
This commit is contained in:
Родитель
2dee2662d8
Коммит
8be9138de2
|
@ -26,8 +26,8 @@ describe "Process.times" do
|
||||||
# If getrusage has precision beyond milliseconds, there will be
|
# If getrusage has precision beyond milliseconds, there will be
|
||||||
# very likely at least one non-zero microsecond results when
|
# very likely at least one non-zero microsecond results when
|
||||||
# repeating enough.
|
# repeating enough.
|
||||||
time = Process.clock_gettime(:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID)
|
time = Process.clock_gettime(:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID, :nanosecond)
|
||||||
not ('%.6f' % time).end_with?('000')
|
not (time % 1_000_000) == 0
|
||||||
end
|
end
|
||||||
rescue Errno::EINVAL
|
rescue Errno::EINVAL
|
||||||
false
|
false
|
||||||
|
|
Загрузка…
Ссылка в новой задаче