summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-speed-widget/net-speed.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/net-speed-widget/net-speed.lua b/net-speed-widget/net-speed.lua
index 2fb1aa1..8ba708d 100644
--- a/net-speed-widget/net-speed.lua
+++ b/net-speed-widget/net-speed.lua
@@ -104,8 +104,8 @@ local function worker(user_args)
if i%2 == 0 then cur_tx = cur_tx + cur_vals[i] end
end
- local speed_rx = cur_rx - prev_rx
- local speed_tx = cur_tx - prev_tx
+ local speed_rx = (cur_rx - prev_rx) / timeout
+ local speed_tx = (cur_tx - prev_tx) / timeout
widget:set_rx_text(convert_to_h(speed_rx))
widget:set_tx_text(convert_to_h(speed_tx))