16 struct timeval t1, t2 ;
18 unsigned int max, min ;
20 unsigned int values [CYCLES] ;
25 if (wiringPiSetup () == -1)
33 gettimeofday (&t1, NULL) ;
34 gettimeofday (&t2, NULL) ;
36 t = t2.tv_usec - t1.tv_usec ;
37 printf ("Baseline test: %lld\n", t);
39 for (x = 0 ; x < CYCLES ; ++x)
41 gettimeofday (&t1, NULL) ;
42 delayMicroseconds (DELAY) ;
43 gettimeofday (&t2, NULL) ;
45 t = t2.tv_usec - t1.tv_usec ;
46 if (t > max) max = t ;
47 if (t < min) min = t ;
51 printf ("Done: Max: %d, min: %d\n", max, min) ;
53 for (x = 0 ; x < CYCLES ; ++x)
55 printf ("%4d", values [x]) ;
56 if (values [x] > DELAY)
58 else if (values [x] < DELAY)
62 if (((x + 1) % 20) == 0)