aboutsummaryrefslogtreecommitdiff
path: root/zencore/stats.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-03 17:08:32 +0200
committerStefan Boberg <[email protected]>2021-10-03 17:08:32 +0200
commit5f4f5ab05019ff6e903db70f5b15878773eb120d (patch)
treeceae29d6bd090446837ca5a0d336bb921936d95b /zencore/stats.cpp
parentstructured cache: Added some more stats (hits/misses/upstream_hits) (diff)
parentMerged from upstream (diff)
downloadzen-5f4f5ab05019ff6e903db70f5b15878773eb120d.tar.xz
zen-5f4f5ab05019ff6e903db70f5b15878773eb120d.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/stats.cpp')
-rw-r--r--zencore/stats.cpp11
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;
}
//////////////////////////////////////////////////////////////////////////