This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6713 Benchmarking with clock()

Other Parts Discussed in Thread: TMS320C6713B

I'm attempting to benchmark a function on the C6713 without DSP/BIOS but am having issues with the clock() function's performance.  It works fine on a hello_world example but prints out 0 or garbage in the test program.  Is there some interfering function call I'm making?

Test Program

#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "globals.h"
#include "sin.h"
#include <math.h>
...
...
...
void testFunc()
{
	// Enable time keeping registers
	//TSCL = 0;
	long long topCount = 1;
	srand(time(NULL));
	printf("\n%lld", clock());
	while (1)
	{
		//long long start, end;
		clock_t start, end;
		unsigned int i;
		clock_t runningTotal = 0;
		long long average = 0;
		for (i = 0; i < NUM_AVERAGE; i++)
		{
			//start = _itoll(TSCH, TSCL);
			//start = CLK_gethtime();
			start = clock();

			initFunc();

			for (i = 0; i < topCount; i++)
			{
				func();
				printf("\n%lld", clock());
			}

			//end = _itoll(TSCH, TSCL);
			//end = CLK_gethtime();
			end = clock();

			printf("\n%lld %lld", start, end);

			runningTotal += (end - start);
		}
		average = runningTotal / NUM_AVERAGE;
		printf("\nFunc ");
		printCount(0, 10, topCount);
		printf("X : ");
		printCount(1, 25, average);
		printf("\t\t\t%f sec", (double)average/(double)CLK_SPEED);
		topCount *= 10;
	}
}

/*
 *  ======== main ========
 */
int main()
{
	printf("%lld\n", clock());
	printf("%lld\n", clock());
	printf("%lld\n", clock());
	printf("%lld\n", clock());
	printf("%lld\n", clock());
	taskFxn();
	return(0);
}

Output:

4611826755915743232
4611826755915743232
4611826755915743232
4611826755915743232
4611826755915743232

4611826755915743232
4611826755915743232
0 -8936549035586516012
Func 1X : 0.000000 sec
0
0
0
0
0
0
0
0
0
0
0 -8936549035586516012
Func 10X : 0.000000 sec
0
0
0
0