2 * Copyright 2015, Anton Blanchard, IBM Corp.
3 * Licensed under GPLv2.
11 static int test_gettimeofday(void)
15 struct timeval tv_start, tv_end;
17 gettimeofday(&tv_start, NULL);
19 for(i = 0; i < 100000000; i++) {
20 gettimeofday(&tv_end, NULL);
23 printf("time = %.6f\n", tv_end.tv_sec - tv_start.tv_sec + (tv_end.tv_usec - tv_start.tv_usec) * 1e-6);
30 return test_harness(test_gettimeofday, "gettimeofday");