mirror of
https://github.com/mborgerding/kissfft.git
synced 2025-07-18 21:14:24 -04:00
benchmark utilities now give memory info
This commit is contained in:
@ -5,13 +5,13 @@
|
||||
#include <unistd.h>
|
||||
#include "kiss_fft.h"
|
||||
|
||||
#include "pstats.h"
|
||||
|
||||
int main(int argc,char ** argv)
|
||||
{
|
||||
int nfft=1024;
|
||||
int isinverse=0;
|
||||
int numffts=1000,i;
|
||||
struct tms t0,t1;
|
||||
float cputime;
|
||||
kiss_fft_cpx * buf;
|
||||
kiss_fft_cpx * bufout;
|
||||
void *st;
|
||||
@ -40,27 +40,20 @@ int main(int argc,char ** argv)
|
||||
buf[i].i = rand() - RAND_MAX/2;
|
||||
}
|
||||
|
||||
times(&t0);
|
||||
pstats_init();
|
||||
|
||||
st = kiss_fft_alloc( nfft ,isinverse );
|
||||
|
||||
for (i=0;i<numffts;++i)
|
||||
kiss_fft_io( st ,buf,bufout );
|
||||
|
||||
free(st);
|
||||
times(&t1);
|
||||
|
||||
free(buf); free(bufout);
|
||||
|
||||
cputime = ( ((float)t1.tms_utime + t1.tms_stime + t1.tms_cutime + t1.tms_cstime ) -
|
||||
((float)t0.tms_utime + t0.tms_stime + t0.tms_cutime + t0.tms_cstime ) )
|
||||
/ sysconf(_SC_CLK_TCK);
|
||||
fprintf(stderr,"KISS\tnfft=%d\tnumffts=%d\n" ,nfft,numffts);
|
||||
pstats_report();
|
||||
|
||||
fprintf(stderr,"KISS\t"
|
||||
"nfft=%d\t"
|
||||
"numffts=%d\t"
|
||||
"cputime=%.3f\n" ,
|
||||
nfft,numffts,cputime
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user