You can always check a timer, launch the program, wait for it to quit, then check and compare the timer again. This will give your answer in whatever units the timer uses --which is usually based upon how fast the CPU's little quartz vibrates.
Using thetimecommand will offer you the user space time and the kernel time which your programm has been consumed.
When knowing the CPU cycle time, you may appoximate the number of cycles.
Excample: time myprog
Note: When your app is mutlithreaded, thentimemay show just the consumed time of the parent thread/process (tested in AVR32 Linux).
The time command provides just milliseconds. If you need more precision you can use the C functions setitimer() and getitimer() at the beginning and the end of your code to get the consumed time in microseconds.
Thank you for the responds,
What i meant by number of cycle is, the time that that is needed by processor to run complete c program, the return information should be in number of instruction cycle (http://en.wikipedia.org/wiki/Instruction_cycle), basically i want to have a high precision of timing.
to joem: settimer() and gettimer () functions, does return High resolution timing?
Sorry, not to clearly point out the problem