summaryrefslogtreecommitdiff
path: root/examples/example3/example3.c
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2019-01-08 16:45:04 +0900
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2019-05-06 15:55:01 +0900
commitdf6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e (patch)
tree6356575d4f9e6461769f7b40b72829366feb37b4 /examples/example3/example3.c
parent4fe69b0927f4c5d0cb3b3ae4fa64500db22b13d0 (diff)
downloadDLT-daemon-df6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e.tar.gz
POSIX: Replace usleep with nanosleep
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'examples/example3/example3.c')
-rw-r--r--examples/example3/example3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/example3/example3.c b/examples/example3/example3.c
index d686ec1..5a74ef1 100644
--- a/examples/example3/example3.c
+++ b/examples/example3/example3.c
@@ -57,6 +57,7 @@ DLT_DECLARE_CONTEXT(con_exa3);
int main()
{
int num;
+ struct timespec ts;
DLT_REGISTER_APP("EXA3", "Third Example");
DLT_REGISTER_CONTEXT(con_exa3, "CON", "First context");
@@ -67,7 +68,9 @@ int main()
DLT_LOG_ID(con_exa3, DLT_LOG_INFO, DLT_EXA3_CON_EXA3_ID1, DLT_INT32(12345678), DLT_CSTRING("Hello world 1!"));
DLT_LOG_ID(con_exa3, DLT_LOG_ERROR, DLT_EXA3_CON_EXA3_ID2, DLT_INT32(87654321), DLT_CSTRING("Hello world 2!"));
DLT_LOG_ID(con_exa3, DLT_LOG_WARN, DLT_EXA3_CON_EXA3_ID3, DLT_INT32(11223344), DLT_CSTRING("Hello world 3!"));
- usleep(1000);
+ ts.tv_sec = 0;
+ ts.tv_nsec = 1000000;
+ nanosleep(&ts, NULL);
}
DLT_UNREGISTER_CONTEXT(con_exa3);