Skip to content

Commit ae18a4c

Browse files
committed
Prefer using std::this_thread::sleep over platform-specific sleeps
1 parent cdaaa10 commit ae18a4c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

examples/dashboard_example.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232

3333
#include <ur_client_library/log.h>
3434
#include <ur_client_library/ur/dashboard_client.h>
35-
#include <ur_client_library/comm/socket_t.h>
3635

37-
#include <iostream>
3836
#include <memory>
3937
#include <thread>
4038

@@ -100,11 +98,7 @@ int main(int argc, char* argv[])
10098
return 1;
10199
}
102100

103-
#ifdef _WIN32
104-
::Sleep(1000);
105-
#else // _WIN32
106-
sleep(1);
107-
#endif // _WIN32
101+
std::this_thread::sleep_for(std::chrono::seconds(1));
108102

109103
// Play loaded program
110104
if (!my_dashboard->commandPlay())

0 commit comments

Comments
 (0)