From: noname@inventati.org Date: Sat, 18 Apr 2015 16:46:17 +0000 (+0200) Subject: Monotonic clock cannot jump backwards. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=c27c731b9f77c1b1c99f3bde737be53996809fcb;p=st.git Monotonic clock cannot jump backwards. The check was introduced back when st used gettimeofday. The condition is also modified to increment the accuaracy of the calculation. --- diff --git a/st.c b/st.c index bf5b675..c7589f4 100644 --- a/st.c +++ b/st.c @@ -4003,8 +4003,7 @@ run(void) { dodraw = 1; } deltatime = TIMEDIFF(now, last); - if(deltatime > (xev? (1000/xfps) : (1000/actionfps)) - || deltatime < 0) { + if(deltatime > 1000 / (xev ? xfps : actionfps)) { dodraw = 1; last = now; }