#define waitx(s) {struct timeval tm = {s, 0};select(0, NULL, NULL, NULL, &tm);} //TODO...:define original results "before" while (1) { //TODO..:gain current results "last" if (before.b == last.b || last.c > 100) { //TODO...:trap warning } waitx(5); }