3
* Standalone BogoMips program
5
* Based on code Linux kernel code in init/main.c and
6
* include/linux/delay.h
8
* For more information on interpreting the results, see the BogoMIPS
12
* author: Jeff Tranter (Jeff_Tranter@Mitel.COM)
14
* Modified for inclusion with Linux_Logo -- Vince Weaver
20
/* portable version */
21
static void delay(int loops)
24
for (i = loops; i >= 0 ; i--)
28
float external_bogomips() {
30
unsigned long loops_per_sec = 1;
33
while ((loops_per_sec <<= 1)) {
36
ticks = clock() - ticks;
37
if (ticks >= CLOCKS_PER_SEC) {
38
loops_per_sec = (loops_per_sec / ticks) * CLOCKS_PER_SEC;
39
return (float)loops_per_sec/500000;