title: Porting clock_gettime to windows
body: <p>I have the following code running on qnx momemntics.</p>
  
  <pre><code>#define BILLION 1000000000L;
  
  struct timespec start_time;
  struct timespec stop_time; 
  
  void start MyTestFunc() {
      //Initialize the Test Start time
       clock_gettime(CLOCK_REALTIME,&amp;start_time)
      // ... additonal code.
  
      cout &lt;&lt; "The exectuion time of func "&lt;&lt; calculateExecutionTime();
  }
  
  
  double calculateExecutionTime ()
  {
  
      clock_gettime(CLOCK_REALTIME,&amp;stop_time);
  
      double dSeconds = (stop_time.tv_sec - start_time.tv_sec);
  
      double dNanoSeconds = (double)( stop_time.tv_nsec - start_time.tv_nsec ) / BILLION;
  
      return dSeconds + dNanoSeconds;
  }
  </code></pre>
  
  <p>Now i want to port above code to windows. can any one provide sample code.</p>
  
  <p>Thanks!</p>