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

@ -95,10 +95,6 @@ is($x->input_focus, $different_window->id, 'new window focused again');
$top->add_hint('urgency');
sync_with_i3;
# Unfortunately, we cannot get rid of this delay. We need it because i3 stores
# the time of an urgency hint with second precision.
sleep 1;
$bottom->add_hint('urgency');
sync_with_i3;
@ -123,10 +119,6 @@ is($x->input_focus, $different_window->id, 'new window focused again');
$top->add_hint('urgency');
sync_with_i3;
# Unfortunately, we cannot get rid of this delay. We need it because i3 stores
# the time of an urgency hint with second precision.
sleep 1;
$bottom->add_hint('urgency');
sync_with_i3;