1 /* Ltrace Test : time-record.c. 2 Objectives : Verify that Ltrace can record timestamp and spent 3 time inside each call. 4 5 This file was written by Yao Qi <qiyao@cn.ibm.com>. */ 6 #include <stdio.h> 7 #include <time.h> 8 9 #define SLEEP_COUNT 2 10 #define NANOSLEEP_COUNT 50 11 12 int main()13main () 14 { 15 struct timespec request, remain; 16 request.tv_sec = 0; 17 request.tv_nsec = NANOSLEEP_COUNT * 1000000; 18 19 sleep (SLEEP_COUNT); 20 nanosleep (&request, NULL); 21 22 return 0; 23 } 24