修改页面样式,修复网速的准确度

This commit is contained in:
2019-04-22 05:59:22 +08:00
committed by JerryYan
parent 17d2cc4ebd
commit 5c1f712900
6 changed files with 26 additions and 21 deletions

View File

@ -54,18 +54,18 @@ def doClean():
def getCurrentStatus():
_disk = psutil.disk_usage("/")
_mem = psutil.virtual_memory()
_net = psutil.net_io_counters()
_delta= getTimeDelta(datetime.now(),network["currentTime"])
if getTimeDelta(datetime.now(), _do_move_time) > 3600:
p = threading.Thread(target=doClean)
p.setDaemon(True)
p.start()
_net = psutil.net_io_counters()
if 60 > _delta > 0:
_inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta
_outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta
else:
_outSpeed = 0
_inSpeed = 0
if getTimeDelta(datetime.now(), _do_move_time) > 3600:
p = threading.Thread(target=doClean)
p.setDaemon(True)
p.start()
updateNetwork()
return {
"memTotal": parseSize(_mem.total),