Browse Source

logging range fixes

devel
Stefan Holst 4 years ago
parent
commit
dfbc35eeb9
  1. 6
      src/kyupy/__init__.py

6
src/kyupy/__init__.py

@ -34,11 +34,11 @@ def hr_time(seconds): @@ -34,11 +34,11 @@ def hr_time(seconds):
if seconds >= 3600:
h = seconds // 3600
seconds -= h * 3600
s += f'{h}h'
s += f'{int(h)}h'
if seconds >= 60 or len(s) > 0:
m = seconds // 60
seconds -= m * 60
s += f'{m}m'
s += f'{int(m)}m'
return f'{s}{int(seconds)}s'
@ -70,7 +70,7 @@ class Log: @@ -70,7 +70,7 @@ class Log:
yield i
current_time = time.perf_counter()
if current_time > lastlog_time + log_interval:
work_done = elem / elems
work_done = (elem + 1) / elems
elapsed_time = current_time - start_time
total_time = elapsed_time / work_done
remaining_time = total_time - elapsed_time

Loading…
Cancel
Save