00001 // 00002 // Copyright (c) 2012 Daniel Lundin 00003 // 00004 00005 #ifndef MEDIDA_TIMER_CONTEXT_H_ 00006 #define MEDIDA_TIMER_CONTEXT_H_ 00007 00008 #include <chrono> 00009 #include <memory> 00010 00011 namespace medida { 00012 00013 class Timer; 00014 00015 class TimerContext { 00016 public: 00017 TimerContext(Timer& timer); 00018 ~TimerContext(); 00019 void Reset(); 00020 std::chrono::nanoseconds Stop(); 00021 private: 00022 class Impl; 00023 Impl* impl_; 00024 // std::unique_ptr<Impl> impl_; // FIXME: y u incomplete type?!? 00025 }; 00026 00027 } // namespace medida 00028 00029 #endif // MEDIDA_TIMER_CONTEXT_H_