rubyx/test/bench/c/adds.c
Torsten Ruger f865486f1e tweeks to the c tests
also figured out hello was caching stopped that to make results
comparable
even wrote a hello assembler version which is just 10% faster than soml
:-)
2015-11-21 16:33:07 +02:00

28 lines
339 B
C

#include<stdio.h>
int fibo(int n){
int result;
int a = 0;
int b = 1;
int i = 1;
while( i < n )
{
result = a + b;
a = b;
b = result;
i++;
}
return result;
}
int main(void)
{
int counter = 100352 - 352;
int counter2 = counter;
int level = 40;
int fib ;
while(counter--) {
fib = fibo(level);
}
}