Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <unistd.h>
  3. #include <time.h>
  4.  
  5. unsigned int usleep(unsigned int _useconds)
  6. {
  7.  clock_t cl_time;
  8.  clock_t start_time = clock();
  9.  _useconds >>= 10;
  10.  cl_time = _useconds * CLOCKS_PER_SEC / 977;
  11.  while (1)
  12.  {
  13.   clock_t elapsed = clock() - start_time;
  14.   if (elapsed >= cl_time) break;
  15.   __menuet__delay100(1);
  16.  }
  17.  return 0;
  18. }
  19.