Sign in

username:

password:



Not a member?

Search code-comp



Search tips

Subscribe to code-comp



code-comp by Keywords

ARM7 | BIOS | Bug | EVM | JTAG | Linker | LOG_printf | McBSP | Profiling | Relocation | RTDX | Simulator | Target | Watch

Ads

Discussion Groups

Discussion Groups | Code-Composer | How to use clock() function to get the processing time

Technical discussions about Code Composer Studio.

  

Post a new Thread

How to use clock() function to get the processing time - Li Bing - Aug 29 10:30:00 2005



HI, all DSP friends I am using C6711 Device Cycles Accurate Simulator in CCS 3.0 IDE. I want to
use clock() function to obtain processing time of a code, I used a sample
code from CCS manual , but can not get the desired results, the result is
always 0. The following is the code. Anybody can give me some hint about
using clock() function to get the processing time for a code.

You help is great appreciated.
Regards
Li Bing

#include <stdio.h>
#include <time.h>

main()
{
clock_t start;
clock_t overhead;
clock_t elapsed;

/* Calculate the overhead from calling clock() */

start = clock();
overhead = clock() - start;

/* Calculate the elapsed time */

start = clock();
puts("Hello, world");
elapsed = clock() - start - overhead;

printf("Time = %ld cycles\n", (long)elapsed);
}





(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )