title: How to test the CPU with a simple C++ program
body: <p>In my opinion, I have two ways to do this:<br>
  One is to use a loop:<br></p>
  
  <pre><code>t1 = getTime();
  for(int i = 0; i &lt; 9999999; i++)
  {}
  t2 = getTime();
  </code></pre>
  
  <p>And now I can check <code>t2 - t1</code>.</p>
  
  <p>The other is to create many threads, each thread does the same loop above.<br></p>
  
  <p>I don't know if the second way is better than the first one.<br></p>
  
  <p>Or maybe there are better ways to test CPU?</p>