summaryrefslogtreecommitdiff
path: root/src/tests/dlt-test-stress-user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/dlt-test-stress-user.c')
-rw-r--r--src/tests/dlt-test-stress-user.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tests/dlt-test-stress-user.c b/src/tests/dlt-test-stress-user.c
index 5cd3a65..5b7047b 100644
--- a/src/tests/dlt-test-stress-user.c
+++ b/src/tests/dlt-test-stress-user.c
@@ -232,6 +232,7 @@ int testall(int count, int repeat, int delay, int size)
{
char buffer[size];
int num, rnum;
+ struct timespec ts;
for (num = 0; num < size; num++)
buffer[num] = num;
@@ -243,7 +244,9 @@ int testall(int count, int repeat, int delay, int size)
for (rnum = 0; rnum < repeat; rnum++)
for (num = 1; num <= count; num++) {
DLT_LOG(context_info, DLT_LOG_INFO, DLT_INT(num), DLT_RAW(buffer, size));
- usleep(delay);
+ ts.tv_sec = (delay * 1000) / 1000000000;
+ ts.tv_nsec = (delay * 1000) % 1000000000;
+ nanosleep(&ts, NULL);
}
/* wait 5 seconds after test */