| 249 | class ScopedTimer { |
| 250 | public: |
| 251 | ScopedTimer(std::ostream* out, const char* tag, |
| 252 | bool measure_mem_usage = false) |
| 253 | : timer(new TimerType(out, measure_mem_usage)), tag_(tag) { |
| 254 | timer->Start(); |
| 255 | } |
| 256 | |
| 257 | // At the end of the scope surrounding the instance of this class, this |
| 258 | // destructor saves the last status of resource usage and reports it. |