Explorar o código

[stress] Fixes seconds display for subsecond results

Ask Solem %!s(int64=9) %!d(string=hai) anos
pai
achega
60e4bfcfe4
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      funtests/stress/stress/suite.py

+ 4 - 2
funtests/stress/stress/suite.py

@@ -60,10 +60,12 @@ class StopSuite(Exception):
 
 
 def pstatus(p):
+    runtime = monotonic() - p.runtime
+    elapsed = monotonic() - p.elapsed
     return F_PROGRESS.format(
         p,
-        runtime=humanize_seconds(monotonic() - p.runtime, now='0 seconds'),
-        elapsed=humanize_seconds(monotonic() - p.elapsed, now='0 seconds'),
+        runtime=humanize_seconds(runtime, now=runtime),
+        elapsed=humanize_seconds(elapsed, now=elapsed),
     )