If you read the manual page of clock_gettime
you would see that
clock_gettime() return 0 for success, or -1 for failure.
So, you are printing the return code only. To print start time and stop time you will need to print the content of variables start
and stop
. For example:
printf("Start time: %d.%09d\n", start.tv_sec, start.tv_nsec);