To whoever is using the following code for timing code execution in C
Originally Posted by [B]vijayan121 [/B]

#include<time.h>
blah blah
 main()   
{      
      clock_t start, end;
      double cpu_time_used;
      start = clock();
       /* whatever */
       end = clock();
       cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;

}

if you are wondering why the time displayed is compiler specific instead of being processor specific the solution is here:
Applications should use sysconf(_SC_CLK_TCK) to determine the number of clock ticks per second as it may vary from system to system.
http://www.opengroup.org/onlinepubs/000095399/functions/times.html
http://www.opengroup.org/onlinepubs/000095399/functions/sysconf.html
Courtesy great google and opengroup.org

Your post has two flaws:
1) it assume the user is running *nix operating system. That may, or may not be correct.

2) Your post is irrelevent because it has nothing at all to do with using the clock() function.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.