title: Measuring running time of a function on iPad
body: <p>I want to know the exact time consumed by a certain function running on iPad.
  For some reason I can't connect the iPad to the macbook while running the application (the USB is occupied by other device).</p>
  
  <p>I had tried using clock(), like this</p>
  
  <pre><code>clock_t start = clock();
  
  /* Do something here */
  
  double executionTime = (double)(clock()-start) / CLOCKS_PER_SEC;
  </code></pre>
  
  <p>I have no idea why the value of executionTime will be 0.
  The difference of start time and end time is something like 1,000,000,000 (Calculated by myself). However I can't get the correct CLOCKS_PER_SEC(it changes every time), so I have no idea what the meaning of that number.</p>
  
  <p>I read the post "ctime on iOS device not measuring time properly", but it does not help.
  Is there any way to fix the CLOCKS_PER_SEC? Or there's other way to measure the time.</p>
  
  <p>Thank you</p>
  
  <p>The value of CLK_TCK is 1,000,000.
  The whole program finishes with 5 seconds.</p>