方法1
#include <time.h>
start = clock();
stop = clock();
overhead = start - stop;
start = clock();
.....do Something....
stop = clock();
t = stop - start - overhead;
方法2
利用TSCL和TSCH来测量DSP程序运行时间
#include <c6x.h>
#include <stdio.h>
unsigned long long start;
unsigned long long end;
TSCH = 0; //Very important! Enable the registers.
TSCL = 0; //Very important! Enable the registers.
start = _itoll (TSCH, TSCL);
// start = TSCL;
...
end = _itoll (TSCH, TSCL);
// end = TSCL;
printf("%d DSP-cycles\n", end - start);