From 0a03fc859e8387a4e92379869dffd610b094c185 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Tue, 23 Oct 2018 18:10:55 +0200 Subject: [PATCH] [module/traffic] Make speed calculation work with fractionals thanks to @ilmagico for noticing this, fractonal intervals are supported, so they should calculate the throughput correctly. fixes #306 --- bumblebee/modules/traffic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/traffic.py b/bumblebee/modules/traffic.py index 60255da..b0fb75e 100644 --- a/bumblebee/modules/traffic.py +++ b/bumblebee/modules/traffic.py @@ -73,7 +73,7 @@ class Module(bumblebee.engine.Module): del widgets[:] counters = psutil.net_io_counters(pernic=True) - now = int(time.time()) + now = time.time() timediff = now - (self._lastcheck if self._lastcheck else now) if timediff <= 0: timediff = 1 self._lastcheck = now