title: always getting 0.00 when try to calculating execution time in C
body: <p>hey there i'm trying to calculate execution time of a simple multithreaded programme on UBUNTU. despite of i researched and used various methods, i always get 0.0000 value. here is my simple code</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;pthread.h&gt;
  #include &lt;time.h&gt;
  
  clock_t startm, stopm;
  #define START if ( (startm = clock()) == -1) {printf("Error calling clock");exit(1);}
  #define STOP if ( (stopm = clock()) == -1) {printf("Error calling clock");exit(1);}
  #define PRINTTIME printf( "%6.9f seconds used by the processor.\n", ((double)stopm-startm)/CLOCKS_PER_SEC);
  
  void* thread_function(int);
  void function();
  
  int total=0;
  int counter;
  
  pthread_mutex_t mutex1=PTHREAD_MUTEX_INITIALIZER;
  
  int main(int argc, char* argv[]) {
  
      START
      counter = atoi(argv[1]);
      function();
      STOP
      PRINTTIME
      return;
  }
  
  void function(){
      int i;
  
      pthread_t t_array[counter];
  
      for(i=0; i&lt;counter; i++){
          pthread_create(&amp;t_array[i], NULL, thread_function, i);
      }
  
      for(i=0; i&lt;counter; i++){
          pthread_join(t_array[i],NULL);
      }
      printf("Total = %d\n", total);
  }
  
  void* thread_function(int index){
  
     pthread_mutex_lock( &amp;mutex1 );
  
     printf("Index : %d\n", index);
     total++;
     usleep(100000);
  
     pthread_mutex_unlock( &amp;mutex1 );
  
  }
  </code></pre>
  
  <p>i will appreciate if you can help and thanks anyway.</p>