home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / utilities / cli / pgp2 / src / c / sleep < prev    next >
Encoding:
Text File  |  1995-06-06  |  568 b   |  30 lines

  1. /*************
  2. * sleep.c -- provide unix style sleep function
  3. *
  4. *************/
  5. #include <time.h>
  6.  
  7. int sleep(unsigned secs){
  8.     long    start;
  9.     long    check;
  10.     long    finish;
  11.  
  12.     time((time_t*)&start);    /* GJM */
  13.     finish = start + (long) secs;
  14. #ifdef DEBUG
  15.     printf ("sleep for %d secs, stop sleeping at %ld\n", secs, finish);
  16.     time((time_t*)&check);    /* GJM */
  17.     printf ("it is now %ld\n", check );
  18. #endif
  19.     for (;;) {
  20.         time((time_t*)&check);    /* GJM */
  21.         if (check > finish)
  22.             break;
  23.     }
  24.     return (0);
  25. }
  26.  
  27. /* I've put some casts in to pacify the very fussy Acorn compiler
  28.  * -- GJM
  29.  */
  30.