File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,32 @@ def test_clock_res
204204 assert_equal ( "clocktime" , clockres . inspect )
205205 end
206206
207+ def test_clock_actual_res
208+ clockres = %w[
209+ CLOCK_THREAD_CPUTIME_ID CLOCK_PROCESS_CPUTIME_ID
210+ CLOCK_MONOTONIC
211+ ] . map do |c |
212+ begin
213+ clk = Process . const_get c
214+ t0 = t = Process . clock_gettime ( clk )
215+ cnt = 0
216+ times = [ t ]
217+ while times . size < 10
218+ t2 = Process . clock_gettime ( clk )
219+ if t2 != t
220+ times << t2
221+ t = t2
222+ end
223+ cnt += 1
224+ end
225+ [ cnt , times ] . inspect
226+ rescue => e
227+ e . message
228+ end
229+ end
230+ assert_equal ( "clock_actualtimes" , clockres . inspect )
231+ end
232+
207233 def test_force_encoding
208234 @comment = RDoc ::Encoding . change_encoding @comment , Encoding ::UTF_8
209235
You can’t perform that action at this time.
0 commit comments