19 #include "../../include/ecl/time/sleep.hpp"
23 std::cout << std::endl;
24 std::cout <<
"***********************************************************" << std::endl;
25 std::cout <<
" Sleep" << std::endl;
26 std::cout <<
"***********************************************************" << std::endl;
27 std::cout << std::endl;
30 ecl::MilliSleep sleep;
31 ecl::MilliSleep sleep_ms;
32 ecl::MicroSleep sleep_us;
33 ecl::NanoSleep sleep_ns;
35 std::cout <<
"Sleep: Duration 1s 300000000ns" << std::endl;
37 std::cout <<
"Sleep: 1s" << std::endl;
39 std::cout <<
"MilliSleep: 500 x 2 = 1s" << std::endl;
40 for (
int i = 0; i < 2; ++i ) { sleep_ms(500); }
41 std::cout <<
"MicroSleep: 500,000 x 2 = 1s" << std::endl;
42 for (
int i = 0; i < 2; ++i ) { sleep_us(500000); }
43 std::cout <<
"NanoSleep: 500,000,000 x 2 = 1s" << std::endl;
44 for (
int i = 0; i < 2; ++i ) { sleep_ns(500000000); }
46 std::cout << std::endl;
47 std::cout <<
"***********************************************************" << std::endl;
48 std::cout <<
" Pre Configured Sleep" << std::endl;
49 std::cout <<
"***********************************************************" << std::endl;
50 std::cout << std::endl;
52 ecl::Sleep sleep_1_3s(duration);
53 std::cout <<
"Sleep" << std::endl;
55 ecl::MilliSleep sleep_1400ms(1400);
56 std::cout <<
"MilliSleep" << std::endl;
58 ecl::MicroSleep sleep_1400us(1400);
59 std::cout <<
"MicroSleep" << std::endl;
61 ecl::NanoSleep sleep_1400ns(1400);
62 std::cout <<
"NanoSleep" << std::endl;
65 std::cout << std::endl;
66 std::cout <<
"***********************************************************" << std::endl;
67 std::cout <<
" Passed" << std::endl;
68 std::cout <<
"***********************************************************" << std::endl;
69 std::cout << std::endl;