return Standard_True;
}
+#ifdef _WIN32
+ #include <windows.h>
+#else
+ #include <unistd.h>
+#endif
+
//=======================================================================
//function : OSDSecSleep
//purpose : Cause the process to sleep during a amount of seconds
//=======================================================================
-
+void OSD::SecSleep (const Standard_Integer theSeconds)
+{
#ifdef _WIN32
-# include <windows.h>
-# define SLEEP(NSEC) Sleep(1000*(NSEC))
+ Sleep (theSeconds * 1000);
#else
-#include <unistd.h>
-# define SLEEP(NSEC) sleep(NSEC)
+ usleep (theSeconds * 1000 * 1000);
#endif
-
-void OSD::SecSleep(const Standard_Integer aDelay)
-{
- SLEEP(aDelay);
}
//=======================================================================
//function : MilliSecSleep
//purpose : Cause the process to sleep during a amount of milliseconds
//=======================================================================
-
-#ifdef _WIN32
-
-void OSD::MilliSecSleep(const Standard_Integer aDelay)
+void OSD::MilliSecSleep (const Standard_Integer theMilliseconds)
{
- Sleep(aDelay) ;
-}
-
+#ifdef _WIN32
+ Sleep (theMilliseconds);
#else
-
-#include <sys/time.h>
-
-void OSD::MilliSecSleep(const Standard_Integer aDelay)
-{
- struct timeval timeout ;
-
- timeout.tv_sec = aDelay / 1000 ;
- timeout.tv_usec = (aDelay % 1000) * 1000 ;
-
- select(0,NULL,NULL,NULL,&timeout) ;
-}
-
+ usleep (theMilliseconds * 1000);
#endif
+}
Standard_EXPORT static Standard_Boolean ToCatchFloatingSignals();
//! Commands the process to sleep for a number of seconds.
- Standard_EXPORT static void SecSleep (const Standard_Integer aDelay);
-
+ Standard_EXPORT static void SecSleep (const Standard_Integer theSeconds);
+
//! Commands the process to sleep for a number of milliseconds
- Standard_EXPORT static void MilliSecSleep (const Standard_Integer aDelay);
-
+ Standard_EXPORT static void MilliSecSleep (const Standard_Integer theMilliseconds);
+
//! Converts aReal into aCstring in exponential format with a period as
//! decimal point, no thousand separator and no grouping of digits.
//! The conversion is independant from the current locale