- if (select(0,NULL,NULL,NULL,&delay)!=0)
- fprintf(stderr,"%s: in function microsleep: select failed!\n",
- progname);
+ while (actual_counter < base_counter+delay &&
+ actual_counter >= base_counter)
+ actual_counter = Counter2();
+ }
+ else
+ {
+ struct timeval delay;
+
+ delay.tv_sec = usec / 1000000;
+ delay.tv_usec = usec % 1000000;
+
+ if (select(0,NULL,NULL,NULL,&delay) != 0)
+ fprintf(stderr,"%s: in function microsleep: select failed!\n",
+ progname);
+ }