diff options
Diffstat (limited to 'zencore')
| -rw-r--r-- | zencore/include/zencore/stats.h | 1 | ||||
| -rw-r--r-- | zencore/stats.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/zencore/include/zencore/stats.h b/zencore/include/zencore/stats.h index f0efc36d8..1a0817b99 100644 --- a/zencore/include/zencore/stats.h +++ b/zencore/include/zencore/stats.h @@ -209,6 +209,7 @@ public: Scope(OperationTiming& Outer); ~Scope(); + void Stop(); void Cancel(); private: diff --git a/zencore/stats.cpp b/zencore/stats.cpp index f783ccd3d..372bc42f8 100644 --- a/zencore/stats.cpp +++ b/zencore/stats.cpp @@ -416,9 +416,16 @@ OperationTiming::Scope::Scope(OperationTiming& Outer) : m_Outer(Outer), m_StartT OperationTiming::Scope::~Scope() { + Stop(); +} + +void +OperationTiming::Scope::Stop() +{ if (m_StartTick != 0) { m_Outer.Update(GetHifreqTimerValue() - m_StartTick); + m_StartTick = 0; } } |