Execution time calculation in C (not Cpp)

Status
Not open for further replies.

dvtruongson

Member level 1
Joined
Oct 3, 2006
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,456
time calculation in c

Hi all,

Currently, I need to do a project which involved determining execution times of different algorithm. So, I want a code which can help to compute execution time of the codes.
Anyone has any ideas on this matter.

Your help is greatly appreciated.
Thank you very much
 

execution time in c

Check this Pseudo code...

function executiontime()
{
clock_t start;
clock_t diff;
clock_t end;

start= clock();
various algorithm;
end = clock();

diff = end - start;
print diff;

}
 

execution time c

Hi Vinseth, what header file I should input for clock() function? Can you give me more details...Thanks
 

time calculations c

For clock() and clock_t

you need

#include <time.h>
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…