@@ -12,6 +12,8 @@
/* enable strtok */
#define _POSIX_C_SOURCE 200112L
+
+#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
@@ -390,7 +392,10 @@ static void *gen_send_thread(void *arg)
odp_atomic_load_u64(&counters.seq),
odp_atomic_load_u64(&counters.seq)%0xffff);
/* TODO use odp timer */
- usleep(args->appl.interval * 1000);
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = args->appl.interval;
+ nanosleep(&ts, NULL);
}
if (args->appl.number != -1 &&
odp_atomic_load_u64(&counters.seq)
odp_generator.c:391:4: error: implicit declaration of function ‘usleep’ [-Werror=implicit-function-declaration] usleep(args->appl.interval * 1000); Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- example/generator/odp_generator.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)