lots of changes, created Disassembler class, removed a few globals etc.
This commit is contained in:
23
tests/initial_base/BENCHFN.C
Normal file
23
tests/initial_base/BENCHFN.C
Normal file
@@ -0,0 +1,23 @@
|
||||
/* benchfn - benchmark for function calls
|
||||
* Thomas Plum, Plum Hall Inc, 609-927-3770
|
||||
* Let T be the execution time in milliseconds
|
||||
* Then average time per operator = T/major usec
|
||||
* (Because the inner loop has exactly 1000 operations)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
f3() { ;}
|
||||
f2() { f3();f3();f3();f3();f3();f3();f3();f3();f3();f3();} /* 10 */
|
||||
f1() { f2();f2();f2();f2();f2();f2();f2();f2();f2();f2();} /* 10 */
|
||||
f0() { f1();f1();f1();f1();f1();f1();f1();f1();f1();} /* 9 */
|
||||
|
||||
main(int ac, char *av[])
|
||||
{ long d, major;
|
||||
|
||||
printf ("enter number of iterations ");
|
||||
scanf ("%ld", &major);
|
||||
printf("executing %ld iterations\n", major);
|
||||
for (d = 1; d <= major; ++d)
|
||||
f0(); /* executes 1000 calls */
|
||||
printf ("finished\n");
|
||||
}
|
||||
Reference in New Issue
Block a user