13 #if defined(ECL_IS_WIN32)
20 #include "../../include/ecl/time/duration.hpp"
21 #include "../../include/ecl/time/sleep_win.hpp"
35 Sleep::Sleep(
const Duration &duration) {
36 required.tv_sec = duration.sec();
37 required.tv_nsec = duration.nsec();
40 Sleep::Sleep(
const unsigned long &seconds) {
41 required.tv_sec = seconds;
45 void Sleep::operator ()() {
46 TimeError result = sleep(required);
50 void Sleep::operator ()(
const Duration &duration) {
51 required.tv_sec = duration.sec();
52 required.tv_nsec = duration.nsec();
53 TimeError result = sleep(required);
57 void Sleep::operator ()(
const unsigned long &seconds) {
58 required.tv_sec = seconds;
60 TimeError result = sleep(required);
68 MilliSleep::MilliSleep(
const unsigned long &milliseconds) {
69 required.tv_sec = milliseconds/1000;
70 required.tv_nsec = (milliseconds%1000)*1000000;
73 void MilliSleep::operator ()() {
74 TimeError result = sleep(required);
78 void MilliSleep::operator ()(
const unsigned long &milliseconds) {
79 required.tv_sec = milliseconds/1000;
80 required.tv_nsec = (milliseconds%1000)*1000000;
82 TimeError result = sleep(required);
90 MicroSleep::MicroSleep(
const unsigned long µseconds) {
91 required.tv_sec = microseconds/1000000;
92 required.tv_nsec = (microseconds%1000000)*1000;
95 void MicroSleep::operator ()() {
96 TimeError result = sleep(required);
100 void MicroSleep::operator ()(
const unsigned long µ_seconds) {
101 required.tv_nsec = 1000*micro_seconds;
102 TimeError result = sleep(required);
110 NanoSleep::NanoSleep(
const unsigned long &nanoseconds) {
111 required.tv_sec = nanoseconds/1000000000;
112 required.tv_nsec = nanoseconds%1000000000;
115 void NanoSleep::operator ()() {
116 TimeError result = sleep(required);
120 void NanoSleep::operator ()(
const unsigned long &nanoseconds) {
121 required.tv_nsec = nanoseconds;
122 TimeError result = sleep(required);