@@ -188,7 +188,7 @@ function ratio(a::TrialEstimate, b::TrialEstimate)
188
188
end
189
189
190
190
gcratio (t:: TrialEstimate ) = ratio (gctime (t), realtime (t))
191
- cpuratio (t:: TrialEstimate ) = ratio (cputime (t), realtime (t))
191
+ cpuratio (t:: TrialEstimate ) = Timers . ACCURATE_CPUTIME ? ratio (cputime (t), realtime (t)) : NaN
192
192
193
193
# #################
194
194
# TrialJudgement #
@@ -322,16 +322,24 @@ end
322
322
@compat function Base. show (io:: IO , :: MIME"text/plain" , t:: TrialEstimate )
323
323
println (io, " BenchmarkTools.TrialEstimate: " )
324
324
println (io, " realtime: " , prettytime (realtime (t)))
325
- println (io, " cputime: " , prettytime (cputime (t)), " (" , prettypercent (cputime (t) / realtime (t))," )" )
326
- println (io, " gctime: " , prettytime (gctime (t)), " (" , prettypercent (gctime (t) / realtime (t))," )" )
325
+ if Timers. ACCURATE_CPUTIME
326
+ println (io, " cputime: " , prettytime (cputime (t)), " (" , prettypercent (cpuratio (t))," )" )
327
+ else
328
+ println (io, " cputime: " , " NA on Windows, see docs" )
329
+ end
330
+ println (io, " gctime: " , prettytime (gctime (t)), " (" , prettypercent (gcratio (t))," )" )
327
331
println (io, " memory: " , prettymemory (memory (t)))
328
332
print (io, " allocs: " , allocs (t))
329
333
end
330
334
331
335
@compat function Base. show (io:: IO , :: MIME"text/plain" , t:: TrialRatio )
332
336
println (io, " BenchmarkTools.TrialRatio: " )
333
337
println (io, " realtime: " , realtime (t))
334
- println (io, " cputime: " , cputime (t))
338
+ if Timers. ACCURATE_CPUTIME
339
+ println (io, " cputime: " , cputime (t))
340
+ else
341
+ println (io, " cputime: " , " NA on Windows, see docs" )
342
+ end
335
343
println (io, " gctime: " , gctime (t))
336
344
println (io, " memory: " , memory (t))
337
345
print (io, " allocs: " , allocs (t))
340
348
@compat function Base. show (io:: IO , :: MIME"text/plain" , t:: TrialJudgement )
341
349
println (io, " BenchmarkTools.TrialJudgement: " )
342
350
println (io, " realtime: " , prettydiff (realtime (ratio (t))), " => " , realtime (t), " (" , prettypercent (params (t). time_tolerance), " tolerance)" )
343
- println (io, " cputime: " , prettydiff (cputime (ratio (t))), " => " , cputime (t), " (" , prettypercent (params (t). time_tolerance), " tolerance)" )
351
+ if Timers. ACCURATE_CPUTIME
352
+ println (io, " cputime: " , prettydiff (cputime (ratio (t))), " => " , cputime (t), " (" , prettypercent (params (t). time_tolerance), " tolerance)" )
353
+ else
354
+ println (io, " cputime: " , " NA on Windows, see docs" )
355
+ end
344
356
print (io, " memory: " , prettydiff (memory (ratio (t))), " => " , memory (t), " (" , prettypercent (params (t). memory_tolerance), " tolerance)" )
345
357
end
0 commit comments