Add function for getting time spent in execution.