title: How to measure CPU usage
body: <p>I would like to log CPU usage at a frequency of 1 second.</p>
  
  <p>One possible way to do it is via <code>vmstat 1</code> command.</p>
  
  <p>The problem is that the time between each output is not always exactly one second, especially on a busy server. I would like to be able to output the timestamp along with the CPU usage every second. What would be a simple way to accomplish this, without installing special tools?</p>