title: clock_gettime always shows 0
body: <p>I want to measure a wall clock time with <code>clock_gettime</code> but every time I run my code, it shows 0. Why is that? (<strong>I want my result to be in miliseconds.</strong>)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  int main( int argc, char **argv )
    {
      struct timespec start, stop;
      unsigned long accum;
  
      if( clock_gettime( CLOCK_REALTIME, &amp;start) == -1 ) {
        perror( "clock gettime" );
        exit( EXIT_FAILURE );
      }
  
      int i;
      for(i=0; i&lt;100000000; i++){int a = 3; int b = 100; int c = a*b;}
  
      //system( argv[1] );
  
      if( clock_gettime( CLOCK_REALTIME, &amp;stop) == -1 ) {
        perror( "clock gettime" );
        exit( EXIT_FAILURE );
      }
  
      accum = (unsigned long)( (stop.tv_sec - start.tv_sec) * 1000) + (unsigned long)( (stop.tv_nsec - start.tv_nsec) / 1000000 ) +0.5;
      printf( "%lu\n", accum );
      return( EXIT_SUCCESS );
    }
  </code></pre>