From 71e6f829c5d6bf4ea512ccac1c95339d8c014db0 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 17 Jul 2019 09:57:56 +0800 Subject: [PATCH] Test --- Common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common.py b/Common.py index b089119..da5c117 100644 --- a/Common.py +++ b/Common.py @@ -85,12 +85,12 @@ def getCurrentStatus(): _mem = psutil.virtual_memory() _net = psutil.net_io_counters() _delta= getTimeDelta(network[-1]["currentTime"], network[0]["currentTime"]) - if 60 > _delta > 0: + if 60 > _delta > 1: _inSpeed = (network[-1]["in"]["currentByte"] - network[0]["in"]["currentByte"]) / _delta _outSpeed = (network[-1]["out"]["currentByte"] - network[0]["out"]["currentByte"]) / _delta else: - _outSpeed = 0 - _inSpeed = 0 + _outSpeed = (network[-1]["in"]["currentByte"] - network[0]["in"]["currentByte"]) + _inSpeed = (network[-1]["out"]["currentByte"] - network[0]["out"]["currentByte"]) updateNetwork() if getTimeDelta(datetime.now(), doCleanTime) > 3600: doClean()