Skip to content

Commit

Permalink
Truncate download speed if over 100 MB/s
Browse files Browse the repository at this point in the history
  • Loading branch information
Coopydood committed Apr 26, 2024
1 parent 1a99a17 commit b8f64df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/dlosx-arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import random
import argparse
import time
import math

class color:
PURPLE = '\033[95m'
Expand Down Expand Up @@ -256,7 +257,10 @@ def save_image(url, sess, filename='', directory=''):
if (int(time.time()) - lastTime) >= 0.1:
timeTaken = int(time.time()) - lastTime
speed = (((((size / 1048576) - (lastSize)) / (timeTaken))))
speed = round(speed,1)
if speed >= 99:
speed = math.trunc(speed)
else:
speed = round(speed,1)
#print("speed is: ",speed,"MB/s")
timeTaken = 0
lastSize = (size / 2 ** 20) # in MBs
Expand Down

0 comments on commit b8f64df

Please sign in to comment.