$NetBSD: patch-an,v 1.2 2005/03/03 11:54:31 garbled Exp $ --- ./src/timing.c Fri Jun 27 04:52:29 1997 +++ work/hbench-OS/src/timing.c Wed Aug 14 14:11:22 2002 @@ -201,19 +201,24 @@ #ifdef DEBUG printf(">> %d iteration gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.); #endif - while ((time = ((float)rtntime)*clkmul) < 1000000.) { - /* while less than one second */ - num <<= 1; + while ((time = ((float)rtntime)*clkmul) < 1000000./16) { + /* while less than 1/16 second */ + num <<= 2; if ((*workfn)(num, &rtntime) != 0) { num >>= 1; #ifdef DEBUG - printf(">> backing off\n"); + printf(">> backing off to %d iterations\n", num); #endif - break; + return num; } #ifdef DEBUG printf(">> %d iterations gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.); #endif + } + while (time < 1000000.) { + /* while less than one second */ + num <<= 1; + time *= 2; } #ifdef DEBUG printf(">> Choosing %d iterations\n",num);