stopwatch: deal with elapsed == 0 (for whatever reason)

This commit is contained in:
Stefan Harmuth 2021-12-29 08:46:40 +01:00
parent c9f91bbd98
commit ed90adc75c

View File

@ -31,7 +31,7 @@ class StopWatch:
units = ['s', 'ms', 'µs', 'ns'] units = ['s', 'ms', 'µs', 'ns']
unit = 0 unit = 0
elapsed = self.avg_elapsed(divider) elapsed = self.avg_elapsed(divider)
while elapsed < 1: while 0 < elapsed < 1:
elapsed *= 1000 elapsed *= 1000
unit += 1 unit += 1