From 0b394c3f53149d41630d629c62edc3b9663e3497 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 18 Jun 2019 20:15:09 +0200 Subject: [PATCH] Don't need to keep last broadcast time in Profiler class. --- client/TracyProfiler.cpp | 5 +++-- client/TracyProfiler.hpp | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index f2edc4d1..bf2f9ece 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1110,6 +1110,7 @@ void Profiler::Worker() const char* broadcastMsg = nullptr; int broadcastLen = 0; + uint64_t lastBroadcast = 0; #ifndef TRACY_NO_BROADCAST m_broadcast = (UdpBroadcast*)tracy_malloc( sizeof( UdpBroadcast ) ); new(m_broadcast) UdpBroadcast(); @@ -1149,9 +1150,9 @@ void Profiler::Worker() if( m_broadcast ) { auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count(); - if( t - m_lastBroadcast > 3000000000 ) // 3s + if( t - lastBroadcast > 3000000000 ) // 3s { - m_lastBroadcast = t; + lastBroadcast = t; m_broadcast->Send( 8087, broadcastMsg, broadcastLen ); } } diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index c4e83f61..69653d2f 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -552,8 +552,6 @@ private: #else void ProcessSysTime() {} #endif - - uint64_t m_lastBroadcast = 0; }; };