… | |
… | |
529 | |
529 | |
530 | return f; |
530 | return f; |
531 | } |
531 | } |
532 | #endif |
532 | #endif |
533 | |
533 | |
534 | // should not be used in interactive programs, for obvious reasons |
|
|
535 | void rxvt_usleep (int usecs) NOTHROW |
|
|
536 | { |
|
|
537 | #if HAVE_NANOSLEEP |
|
|
538 | struct timespec ts; |
|
|
539 | |
534 | |
540 | ts.tv_sec = 0; |
|
|
541 | ts.tv_nsec = usecs * 1000; |
|
|
542 | nanosleep (&ts, NULL); |
|
|
543 | #else |
|
|
544 | /* use select for timing */ |
|
|
545 | struct timeval tv; |
|
|
546 | |
|
|
547 | tv.tv_sec = 0; |
|
|
548 | tv.tv_usec = usecs; |
|
|
549 | select (0, NULL, NULL, NULL, &tv); |
|
|
550 | #endif |
|
|
551 | } |
|
|
552 | |
|
|
553 | /*----------------------- end-of-file (C source) -----------------------*/ |
|
|
554 | |
|
|