#include "bench.h" /* * Recursion * * This is a recursion-test it's just doing a lot of function calls * and so can be used to benchmark the overhead of calling a function * and returning from it. */ void recursion_f1(int nr) { int x; result_push(CONTEXT_LOCAL, nr); for (x=nr; x > 1; x--) recursion_f1(nr - 1); } void test_recursion() { timer_start(CONTEXT_LOCAL); recursion_f1(11); recursion_f1(11); recursion_f1(11); timer_stop(CONTEXT_LOCAL); }