drm/panel: panel-himax-hx83102: support for csot-pna957qt1-1 MIPI-DSI panel
[drm/drm-misc.git] / tools / testing / selftests / powerpc / benchmarks / gettimeofday.c
blobb71ef8a493ed1ab56ddc6f8b24fcfaa7079b6db5
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright 2015, Anton Blanchard, IBM Corp.
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, tv_diff;
17 gettimeofday(&tv_start, NULL);
19 for(i = 0; i < 100000000; i++) {
20 gettimeofday(&tv_end, NULL);
23 timersub(&tv_end, &tv_start, &tv_diff);
25 printf("time = %.6f\n", tv_diff.tv_sec + (tv_diff.tv_usec) * 1e-6);
27 return 0;
30 int main(void)
32 return test_harness(test_gettimeofday, "gettimeofday");