title: Computing algorithm running time in C
body: <p>I am using the time.h lib in c to find the time taken to run an algorithm. The code structure is somewhat as follows :-</p>
  
  <pre><code>#include &lt;time.h&gt;
  
  int main()
  {
    time_t start,end,diff;
  
    start = clock();
      //ALGORITHM COMPUTATIONS
    end = clock();
    diff = end - start;
    printf("%d",diff);
    return 0;
  }
  </code></pre>
  
  <p>The values for start and end are always zero. Is it that the clock() function does't work? Please help.
  Thanks in advance.</p>