// Sleeps and gives up resources to other threads.
// t is in seconds, t=0 gives shortest possible interval.

#ifdef WIN32

  #include <windows.h>

  void sleep(double t){
    Sleep((DWORD) (1000 * t ));
  };

#else // WIN32

  #include <unistd.h>

  void sleep (double t){
    usleep((unsigned long)(1e6 * t));
  }

#endif // WIN32

As Matthias said, there are tons of (portable) threading libraries (I use 
boost/thread).

R.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to