diff options
author | noname@inventati.org <noname@inventati.org> | 2015-04-18 18:46:17 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-04-20 09:18:40 +0200 |
commit | c27c731b9f77c1b1c99f3bde737be53996809fcb (patch) | |
tree | 69c8e77cf2d4e79b2c892f6f35c5cd160a5cb1e2 | |
parent | 6ee56d65906362f3f6ade570da0ce9c28788eaf5 (diff) | |
download | st-patched-c27c731b9f77c1b1c99f3bde737be53996809fcb.tar.bz2 st-patched-c27c731b9f77c1b1c99f3bde737be53996809fcb.tar.xz st-patched-c27c731b9f77c1b1c99f3bde737be53996809fcb.zip |
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.
-rw-r--r-- | st.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -4003,8 +4003,7 @@ run(void) { | |||
4003 | dodraw = 1; | 4003 | dodraw = 1; |
4004 | } | 4004 | } |
4005 | deltatime = TIMEDIFF(now, last); | 4005 | deltatime = TIMEDIFF(now, last); |
4006 | if(deltatime > (xev? (1000/xfps) : (1000/actionfps)) | 4006 | if(deltatime > 1000 / (xev ? xfps : actionfps)) { |
4007 | || deltatime < 0) { | ||
4008 | dodraw = 1; | 4007 | dodraw = 1; |
4009 | last = now; | 4008 | last = now; |
4010 | } | 4009 | } |