From 80e441ff6683f74d9567f5ea1c96554a5a8836c3 Mon Sep 17 00:00:00 2001 From: tompng Date: Sun, 9 Nov 2025 22:23:42 +0900 Subject: [PATCH] Sync https://github.com/ruby/ruby/pull/14866 Low resolution-clock is added in windows, but it shouldn't be used in assert_linear_performance. ruby/ruby's core_assertion.rb selects clock that has enough resolution. --- lib/core_assertions.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core_assertions.rb b/lib/core_assertions.rb index 00d180f..02038aa 100644 --- a/lib/core_assertions.rb +++ b/lib/core_assertions.rb @@ -835,6 +835,9 @@ def assert_all_assertions_foreach(msg = nil, *keys, &block) rescue # Constants may be defined but not implemented, e.g., mingw. else + unless Process.clock_getres(clk) < 1.0e-03 + next # needs msec precision + end PERFORMANCE_CLOCK = clk end end