Skip to content

Commit eb5aae4

Browse files
committed
Use proper sleep method for Window
1 parent 7eb2647 commit eb5aae4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • examples/PublishHelloWorld

examples/PublishHelloWorld/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
#include <stdio.h> //printf
2121
#include <string.h> //strcmp
2222
#include <stdlib.h> //atoi
23+
24+
#ifndef _WIN32
2325
#include <unistd.h> //sleep
26+
#else
27+
#include <Windows.h>
28+
#endif
2429

2530
#define STREAM_HISTORY 8
2631
#define BUFFER_SIZE UXR_CONFIG_UDP_TRANSPORT_MTU * STREAM_HISTORY
@@ -123,7 +128,12 @@ int main(int args, char** argv)
123128

124129
printf("Send topic: %s, id: %i\n", topic.message, topic.index);
125130
connected = uxr_run_session_time(&session, 1000);
131+
132+
#ifndef _WIN32
126133
sleep(1);
134+
#else
135+
Sleep(1000);
136+
#endif
127137
}
128138

129139
// Delete resources

0 commit comments

Comments
 (0)