Example #1
0
/** Return the fraction of the CPU used (CPUTime/wall-clock time).
 * This can be > 1 on multi-CPU systems.
 *
 * @param doReset :: true to reset both timers
 * @return
 */
float CPUTimer::CPUfraction(bool doReset) {
  // Get the wall-clock time without resetting.
  double wallTime = m_wallClockTime.elapsed(false);
  double cpuTime = elapsedCPU(false);
  if (doReset)
    this->reset();
  return static_cast<float>((cpuTime / wallTime));
}
Example #2
0
uint64_t Timer::elapsed() const {
  if (d_wall_time)
    return elapsedWall();
  return elapsedCPU();
}