1
0
Fork 0
forked from wry/wry

all: fetch current time only once per iteration

This commit is contained in:
Julian Orth 2024-07-11 17:39:18 +02:00
parent d8d6be1ef3
commit bb9e6ba3b5
21 changed files with 99 additions and 97 deletions

View file

@ -5,7 +5,6 @@ use {
ifs::ext_idle_notification_v1::ExtIdleNotificationV1,
leaks::Tracker,
object::{Object, Version},
time::now_usec,
utils::errorfmt::ErrorFmt,
wire::{ext_idle_notifier_v1::*, ExtIdleNotifierV1Id},
},
@ -81,7 +80,7 @@ impl ExtIdleNotifierV1RequestHandler for ExtIdleNotifierV1 {
async fn run(n: Rc<ExtIdleNotificationV1>) {
loop {
let now = now_usec();
let now = n.client.state.now_usec();
let elapsed = now.saturating_sub(n.seat.last_input());
if elapsed < n.duration_usec {
let res = n