[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:
parent
cb04cf6de6
commit
0a03fc859e
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ class Module(bumblebee.engine.Module):
|
||||||
del widgets[:]
|
del widgets[:]
|
||||||
|
|
||||||
counters = psutil.net_io_counters(pernic=True)
|
counters = psutil.net_io_counters(pernic=True)
|
||||||
now = int(time.time())
|
now = time.time()
|
||||||
timediff = now - (self._lastcheck if self._lastcheck else now)
|
timediff = now - (self._lastcheck if self._lastcheck else now)
|
||||||
if timediff <= 0: timediff = 1
|
if timediff <= 0: timediff = 1
|
||||||
self._lastcheck = now
|
self._lastcheck = now
|
||||||
|
|
Loading…
Reference in a new issue