irqchip: Fix dependencies for archs w/o HAS_IOMEM
[linux/fpc-iii.git] / tools / testing / selftests / powerpc / benchmarks / gettimeofday.c
blob3af3c21e803683065fccc24e1923918df94e3c41
1 /*
2 * Copyright 2015, Anton Blanchard, IBM Corp.
3 * Licensed under GPLv2.
4 */
6 #include <sys/time.h>
7 #include <stdio.h>
9 #include "utils.h"
11 static int test_gettimeofday(void)
13 int i;
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);
25 return 0;
28 int main(void)
30 return test_harness(test_gettimeofday, "gettimeofday");