diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2019-01-08 16:45:04 +0900 |
---|---|---|
committer | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2019-05-06 15:55:01 +0900 |
commit | df6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e (patch) | |
tree | 6356575d4f9e6461769f7b40b72829366feb37b4 /examples/example1 | |
parent | 4fe69b0927f4c5d0cb3b3ae4fa64500db22b13d0 (diff) | |
download | DLT-daemon-df6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e.tar.gz |
POSIX: Replace usleep with nanosleep
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'examples/example1')
-rw-r--r-- | examples/example1/example1.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/example1/example1.c b/examples/example1/example1.c index 2784a82..9248ecb 100644 --- a/examples/example1/example1.c +++ b/examples/example1/example1.c @@ -54,13 +54,17 @@ DLT_DECLARE_CONTEXT(con_exa1); int main() { + struct timespec ts; + DLT_REGISTER_APP("EXA1", "First Example"); DLT_REGISTER_CONTEXT(con_exa1, "CON", "First context"); DLT_LOG(con_exa1, DLT_LOG_INFO, DLT_STRING("Hello world!")); - usleep(1000); + ts.tv_sec = 0; + ts.tv_nsec = 1000000; + nanosleep(&ts, NULL); DLT_UNREGISTER_CONTEXT(con_exa1); |