Parcourir la source

[stress] Fixes seconds display for subsecond results

Ask Solem il y a 9 ans
Parent
commit
60e4bfcfe4
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  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),
     )