git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28140
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-void wxUsleep(unsigned long milliseconds)
+void wxMicroSleep(unsigned long microseconds)
{
#if defined(HAVE_NANOSLEEP)
timespec tmReq;
{
#if defined(HAVE_NANOSLEEP)
timespec tmReq;
- tmReq.tv_sec = (time_t)(milliseconds / 1000);
- tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
+ tmReq.tv_sec = (time_t)(microseconds / 1000000);
+ tmReq.tv_nsec = (microseconds % 1000000) * 1000;
// we're not interested in remaining time nor in return value
(void)nanosleep(&tmReq, (timespec *)NULL);
// we're not interested in remaining time nor in return value
(void)nanosleep(&tmReq, (timespec *)NULL);
#error "usleep() cannot be used in MT programs under Solaris."
#endif // Sun
#error "usleep() cannot be used in MT programs under Solaris."
#endif // Sun
- usleep(milliseconds * 1000); // usleep(3) wants microseconds
#elif defined(HAVE_SLEEP)
// under BeOS sleep() takes seconds (what about other platforms, if any?)
#elif defined(HAVE_SLEEP)
// under BeOS sleep() takes seconds (what about other platforms, if any?)
- sleep(milliseconds * 1000);
+ sleep(microseconds * 1000000);
- #error "usleep() or nanosleep() function required for wxUsleep"
+ #error "usleep() or nanosleep() function required for wxMicroSleep"
#endif // sleep function
}
#endif // sleep function
}
+void wxMilliSleep(unsigned long milliseconds)
+{
+ wxMicroSleep(milliseconds*1000);
+}
+
// ----------------------------------------------------------------------------
// process management
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// process management
// ----------------------------------------------------------------------------