Use gettimeofday() and struct timevals instead of time()
Initially I thought using the second precision time() function is good enough, but to make t/113-urgent.t considerably faster (>2s vs. 0.08s), we put in a little more effort and use gettimeofday. Otherwise, this test blocks the whole testsuite from completing much faster on modern machines :).
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#include <xcb/xcb_atom.h>
|
||||
#include <stdbool.h>
|
||||
#include <pcre.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "queue.h"
|
||||
|
||||
@ -305,7 +306,7 @@ struct Window {
|
||||
bool needs_take_focus;
|
||||
|
||||
/** When this window was marked urgent. 0 means not urgent */
|
||||
time_t urgent;
|
||||
struct timeval urgent;
|
||||
|
||||
/** Whether this window accepts focus. We store this inverted so that the
|
||||
* default will be 'accepts focus'. */
|
||||
|
Reference in New Issue
Block a user