From: Pierre-Marc Fournier Date: Fri, 26 Jun 2009 02:36:27 +0000 (-0400) Subject: enhance hello2 X-Git-Tag: v0.1~181 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=09dcbc3d4aac11ca707228eef9ad56295eeca0f8;p=ust.git enhance hello2 --- diff --git a/tests/hello2/hello2.c b/tests/hello2/hello2.c index 836df53..5e7383e 100644 --- a/tests/hello2/hello2.c +++ b/tests/hello2/hello2.c @@ -1,18 +1,27 @@ #include -#include +#include +#include + #include "marker.h" int main() { int i; + struct timespec tv; + struct timespec rem; + int result; + + tv.tv_sec = 1; + tv.tv_nsec = 0; -// sleep(1); + do { + result = nanosleep(&tv, &tv); + } while(result == -1 && errno == EINTR); printf("Hello, World!\n"); for(i=0; i<500; i++) { trace_mark(ust, bar, "str %d", i); trace_mark(ust, bar2, "number1 %d number2 %d", (int)53, (int)9800); - usleep(20); } return 0;