[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
This commit is contained in:
Tobias Witek 2018-10-23 18:10:55 +02:00
parent cb04cf6de6
commit 0a03fc859e

View file

@ -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