--- rxvt-unicode/src/misc.C 2005/02/16 21:37:10 1.27 +++ rxvt-unicode/src/misc.C 2005/08/11 12:31:15 1.29 @@ -610,4 +610,25 @@ } } #endif + +// should not be used in interactive programs, for obvious reasons +void rxvt_usleep (int usecs) +{ +#if HAVE_NANOSLEEP + struct timespec ts; + + ts.tv_sec = 0; + ts.tv_nsec = usecs * 1000; + nanosleep (&ts, NULL); +#else + /* use select for timing */ + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = usecs; + select (0, NULL, NULL, NULL, &tv); +#endif +} + /*----------------------- end-of-file (C source) -----------------------*/ +