12 #ifndef ECL_TIME_SLEEP_WIN_HPP_
13 #define ECL_TIME_SLEEP_WIN_HPP_
20 #if defined(ECL_IS_WIN32)
83 Sleep(
const unsigned long &seconds = 0);
112 void operator()(
const unsigned long &seconds);
122 void operator()(
const Duration &duration);
125 TimeStructure required, remaining;
154 MilliSleep(
const unsigned long &milliseconds = 0);
156 virtual ~MilliSleep() {}
184 void operator()(
const unsigned long &milliseconds);
186 TimeStructure required, remaining;
215 MicroSleep(
const unsigned long µseconds = 0);
217 virtual ~MicroSleep() {}
245 void operator()(
const unsigned long µ_seconds);
247 TimeStructure required, remaining;
276 NanoSleep(
const unsigned long &nanoseconds = 0);
278 virtual ~NanoSleep() {}
306 void operator()(
const unsigned long &nanoseconds);
308 TimeStructure required, remaining;
318 #if defined(ECL_HAS_EXCEPTIONS)
333 int error_result = errno;
334 switch (error_result) {
336 case ( EINVAL ) :
return StandardException(loc,
ecl::InvalidInputError,
"Specified value was negative or exceeded resolution range.\n\n Sleep: [N/A]\n MilliSleep: [0-1000]\n MicroSleep: [0-1x10^6]\n NanoSleep: [0-1x10^9]\n");
337 case ( EFAULT ) :
return StandardException(loc,
ecl::MemoryError,
"Memory error.");
340 std::ostringstream ostream;
341 ostream <<
"Unknown error " << error_result <<
": " << strerror(error_result) <<
".";
342 return StandardException(loc,
UnknownError, ostream.str());