double recent_time(timer_type type = TOTAL_TIME) const { if (!valid_type(type)) throw std::runtime_error("stopwatch: invalid timer type"); if (!running) return 0; switch (type) { case WALL_TIME: return recent_wall_time(); case TOTAL_TIME: return recent_total_time(); case USER_TIME: return recent_user_time(); case SYSTEM_TIME: return recent_system_time(); case PAGEFAULTS: return recent_major_pagefaults(); default: throw std::runtime_error("bug-didn't handle timer type in stopwatch::recent_time"); } }
double recent_total_time() const { return recent_user_time() + recent_system_time(); }