[downloader:http] use 'time.monotonic()'
This commit is contained in:
@@ -296,11 +296,10 @@ class HttpDownloader(DownloaderBase):
|
|||||||
progress = self.progress
|
progress = self.progress
|
||||||
|
|
||||||
bytes_downloaded = 0
|
bytes_downloaded = 0
|
||||||
time_start = time.time()
|
time_start = time.monotonic()
|
||||||
|
|
||||||
for data in content:
|
for data in content:
|
||||||
time_current = time.time()
|
time_elapsed = time.monotonic() - time_start
|
||||||
time_elapsed = time_current - time_start
|
|
||||||
bytes_downloaded += len(data)
|
bytes_downloaded += len(data)
|
||||||
|
|
||||||
write(data)
|
write(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user