#include #include #include #include "fsleep.h" /* Prototype for helper routine .. */ void _fsleep(void); /* Sleeps for the specified number of (floating point) seconds ... */ void fsleep(float secs) { struct itimerval the_timer; the_timer.it_interval.tv_sec = 0; the_timer.it_interval.tv_usec = 0; the_timer.it_value.tv_sec = (int) secs; the_timer.it_value.tv_usec = 1.0e6 * (secs - (int) secs); signal(SIGALRM,_fsleep); setitimer(ITIMER_REAL,&the_timer,&the_timer); pause(); } /* Helper function for fsleep() ... */ void _fsleep(void) { return; }