Posted By

yuconner on 03/09/09


Tagged

cross-platform


Versions (?)

Platform-dependent sleep routines


 / Published in: C
 

  1. // Platform-dependent sleep routines.
  2. #if defined(__WINDOWS_MM__)
  3. #include <windows.h>
  4. #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
  5. #else // Unix variants
  6. #include <unistd.h>
  7. #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
  8. #endif

Report this snippet  

You need to login to post a comment.