예제 #1
0
 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");
   }
 }
예제 #2
0
파일: stopwatch.hpp 프로젝트: SlyryD/carmel
 double recent_total_time() const
 {
     return recent_user_time() + recent_system_time();
 }