aboutsummaryrefslogtreecommitdiff
path: root/zencore/stats.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-03 21:40:20 +0200
committerStefan Boberg <[email protected]>2021-10-03 21:40:20 +0200
commit132c476c82e82ed7978e82067c9159aaeebbd36f (patch)
treeded8d61005361a7d9feb7e5a1aa1153e79d98839 /zencore/stats.cpp
parentMerge branch 'main' of https://github.com/EpicGames/zen (diff)
parenthttp: Moved logic for body suppression to a more central location (diff)
downloadzen-132c476c82e82ed7978e82067c9159aaeebbd36f.tar.xz
zen-132c476c82e82ed7978e82067c9159aaeebbd36f.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;
}
//////////////////////////////////////////////////////////////////////////