#include #include #include /* This program allows Pulse to be invoked once from the command line * (instead of running periodically as a daemon). -- tongli */ _syscall0(void, detect_deadlock); int main() { struct timeval start_time, end_time; int total_time; gettimeofday(&start_time, NULL); detect_deadlock(); gettimeofday(&end_time, NULL); if (end_time.tv_usec >= start_time.tv_usec) { total_time = 1000000 * (end_time.tv_sec - start_time.tv_sec) + end_time.tv_usec - start_time.tv_usec; } else { total_time = 1000000 * (end_time.tv_sec - 1 - start_time.tv_sec) + end_time.tv_usec + 1000000 - start_time.tv_usec; } printf("Time elapsed: %d microseconds\n", total_time); return 0; }