Skip to content

Commit f6e2d5b

Browse files
committed
checksum: fix time_ns import and elapsed_s typo
- Add missing time_ns import - Fix typo: use elapsed_s instead of undefined elapsed variable
1 parent eb575f2 commit f6e2d5b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

blockcopy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from queue import Queue
4747
from sys import exit, stderr, stdin, stdout
4848
from threading import Event, Lock
49-
from time import monotonic
49+
from time import monotonic, time_ns
5050

5151

5252
__version__ = '0.0.3'
@@ -311,7 +311,7 @@ def read_worker():
311311
if abs(now_ns - show_progress_last_output_time_ns) >= 60e9 or (show_progress_pct and show_progress_pct - show_progress_last_output_pct >= 5):
312312
elapsed_s = (now_ns - show_progress_last_output_time_ns) / 1e9
313313
bytes_since_last = block_pos - show_progress_last_output_pos
314-
speed_mb_s = bytes_since_last / 2**20 / elapsed if elapsed_s > 0 else 0
314+
speed_mb_s = bytes_since_last / 2**20 / elapsed_s if elapsed_s > 0 else 0
315315
show_progress_last_output_time_ns = now_ns
316316
show_progress_last_output_pct = show_progress_pct
317317
show_progress_last_output_pos = block_pos

0 commit comments

Comments
 (0)