title: How to get CPU time used by a function in Swift
body: <p>I want to get the CPU time used by a function in Swift. In C we could do this by <a href="http://www.cplusplus.com/reference/ctime/clock/" rel="nofollow noreferrer">clock()</a> function.
  I read <a href="https://stackoverflow.com/questions/24755558/measure-elapsed-time-in-swift">this</a> answer but it measures the real time.
  Any suggestions?</p>