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:
Michael Stapelberg
2012-02-21 13:38:49 +01:00
parent 1ab3621656
commit ab9ba6fcf9
4 changed files with 19 additions and 17 deletions

View File

@ -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'. */