1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <stdio.h>
#include <signal.h>
#include "crinkle.h"
Parm fold_param;
#include <sys/time.h>
long get_millis()
{
struct timeval ts;
long t;
int err;
err = gettimeofday(&ts, NULL);
t = (ts.tv_sec *1000) + ts.tv_usec/1000 ;
return t;
}
void main(int argc, char *argv[]){
Fold *f;
int i;
double sum;
Strip *s;
long stop,start;
seed_uni(121265);
f = make_fold(NULL,&fold_param,10,2,1.0);
for(i=0;i<1000;i++){
s = next_strip(f);
free_strip(s);
}
start = get_millis();
for(i=0;i<1000;i++){
s = next_strip(f);
free_strip(s);
}
stop = get_millis();
printf("time was %ld \n",(stop - start));
}
|