Added code to allow for cpu profiling.