Better localize gettimeofday() call usage
This commit is contained in:
parent
d5ef5bf962
commit
d167b58b24
1 changed files with 4 additions and 4 deletions
|
@ -124,13 +124,9 @@ int main(int argc, char **argv) {
|
||||||
FD_SET(fd2, &rfds);
|
FD_SET(fd2, &rfds);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct timeval now;
|
|
||||||
|
|
||||||
int pending,
|
int pending,
|
||||||
nfds = fd2 + 1;
|
nfds = fd2 + 1;
|
||||||
|
|
||||||
(void)gettimeofday(&now, NULL);
|
|
||||||
|
|
||||||
while ((pending = XPending(display)) != 0) {
|
while ((pending = XPending(display)) != 0) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
|
|
||||||
|
@ -170,8 +166,12 @@ int main(int argc, char **argv) {
|
||||||
case 0x288:
|
case 0x288:
|
||||||
case 0x320:
|
case 0x320:
|
||||||
case 0x5a0: {
|
case 0x5a0: {
|
||||||
|
struct timeval now;
|
||||||
|
|
||||||
cluster_update(&frame);
|
cluster_update(&frame);
|
||||||
|
|
||||||
|
(void)gettimeofday(&now, NULL);
|
||||||
|
|
||||||
if (now.tv_sec - last.tv_sec
|
if (now.tv_sec - last.tv_sec
|
||||||
|| now.tv_usec - last.tv_usec > 16666) {
|
|| now.tv_usec - last.tv_usec > 16666) {
|
||||||
hexagram_window_refresh_bg(window);
|
hexagram_window_refresh_bg(window);
|
||||||
|
|
Loading…
Add table
Reference in a new issue