1 let people specify the number of runs on the command line
3 Patch by Vivi Li <vivi.li@analog.com>
8 /* end of variables for time measurement */
12 +main(int argc, char *argv[])
15 /* main program, corresponds to procedures */
17 /* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
18 /* overflow may occur for this array element. */
22 + if (atoi(argv[1]) > 0) {
23 + Number_Of_Runs = atoi(argv[1]);
28 printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
31 printf ("Program compiled without 'register' attribute\n");
34 - printf ("Please give the number of runs through the benchmark: ");
40 + if (!Number_Of_Runs) {
41 + printf ("Please give the number of runs through the benchmark: ");
52 printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);