net-speed-widget: fix speed calculation

need to divide by time
This commit is contained in:
Nuno Silva 2021-06-06 02:24:32 +01:00
parent 7ecaccf85f
commit c4606372b3
1 changed files with 2 additions and 2 deletions

View File

@ -104,8 +104,8 @@ local function worker(user_args)
if i%2 == 0 then cur_tx = cur_tx + cur_vals[i] end if i%2 == 0 then cur_tx = cur_tx + cur_vals[i] end
end end
local speed_rx = cur_rx - prev_rx local speed_rx = (cur_rx - prev_rx) / timeout
local speed_tx = cur_tx - prev_tx local speed_tx = (cur_tx - prev_tx) / timeout
widget:set_rx_text(convert_to_h(speed_rx)) widget:set_rx_text(convert_to_h(speed_rx))
widget:set_tx_text(convert_to_h(speed_tx)) widget:set_tx_text(convert_to_h(speed_tx))