Better localize gettimeofday() call usage

This commit is contained in:
XANTRONIX Development 2019-06-09 15:56:53 -05:00
parent d5ef5bf962
commit d167b58b24

View file

@ -124,13 +124,9 @@ int main(int argc, char **argv) {
FD_SET(fd2, &rfds);
while (1) {
struct timeval now;
int pending,
nfds = fd2 + 1;
(void)gettimeofday(&now, NULL);
while ((pending = XPending(display)) != 0) {
XEvent e;
@ -170,8 +166,12 @@ int main(int argc, char **argv) {
case 0x288:
case 0x320:
case 0x5a0: {
struct timeval now;
cluster_update(&frame);
(void)gettimeofday(&now, NULL);
if (now.tv_sec - last.tv_sec
|| now.tv_usec - last.tv_usec > 16666) {
hexagram_window_refresh_bg(window);