mirror of
https://github.com/polybar/polybar.git
synced 2026-02-23 17:55:41 +00:00
fix(battery): animation framerate
This commit is contained in:
committed by
Patrick Ziegler
parent
d3844c40b6
commit
e6e010e45b
@ -174,13 +174,16 @@ namespace modules {
|
||||
|
||||
void network_module::subthread_routine() {
|
||||
const chrono::milliseconds framerate{m_animation_packetloss->framerate()};
|
||||
const auto dur = chrono::duration<double>(framerate);
|
||||
|
||||
while (running()) {
|
||||
auto now = chrono::system_clock::now();
|
||||
if (m_connected && m_packetloss) {
|
||||
m_animation_packetloss->increment();
|
||||
broadcast();
|
||||
}
|
||||
sleep(dur);
|
||||
|
||||
now += framerate;
|
||||
this_thread::sleep_until(now);
|
||||
}
|
||||
|
||||
m_log.trace("%s: Reached end of network subthread", name());
|
||||
|
||||
Reference in New Issue
Block a user