diff options
| author | Stefan Boberg <[email protected]> | 2021-10-03 16:43:42 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-03 16:43:42 +0200 |
| commit | ee45d0eaa96e40dc605aab277e2a6b28cab6c7ef (patch) | |
| tree | 221a459d63ce4ed0f81349d6246b96c9ef2cf52a /zencore/stats.cpp | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-ee45d0eaa96e40dc605aab277e2a6b28cab6c7ef.tar.xz zen-ee45d0eaa96e40dc605aab277e2a6b28cab6c7ef.zip | |
stats: added OperationTiming::Scope::Cancel
Diffstat (limited to 'zencore/stats.cpp')
| -rw-r--r-- | zencore/stats.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zencore/stats.cpp b/zencore/stats.cpp index 34dc2828f..47efba76b 100644 --- a/zencore/stats.cpp +++ b/zencore/stats.cpp @@ -398,7 +398,16 @@ OperationTiming::Scope::Scope(OperationTiming& Outer) : m_Outer(Outer), m_StartT OperationTiming::Scope::~Scope() { - m_Outer.Update(GetHifreqTimerValue() - m_StartTick); + if (m_StartTick != 0) + { + m_Outer.Update(GetHifreqTimerValue() - m_StartTick); + } +} + +void +OperationTiming::Scope::Cancel() +{ + m_StartTick = 0; } ////////////////////////////////////////////////////////////////////////// |