Added CPU usage calculation.

* Made functions static.