forked from tmux-plugins/tmux-net-speed
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache results to prevent miscalculations
The code assumes that the status bar will only be updated every status-interval seconds In practice status-interval is a maximum value, not a minimum value. So if the status bar is actually updated every second even though the configuration is for 5 seconds all of the calculations are off and the bitrate will be calculated as a fifth of the real rate. See tmux-plugins/tmux-cpu#15 for a similar issue with a different plugin, except that here it is much worse because it actually leads to a WRONG RESULT and not just a faster update. This commit implements @BrainMaestro 's suggestion from that thread.
- Loading branch information
Showing
3 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters