Don't need to keep last broadcast time in Profiler class.

This commit is contained in:
Bartosz Taudul 2019-06-18 20:15:09 +02:00
parent 99e638b3fc
commit 0b394c3f53
2 changed files with 3 additions and 4 deletions

View File

@ -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 );
}
}

View File

@ -552,8 +552,6 @@ private:
#else
void ProcessSysTime() {}
#endif
uint64_t m_lastBroadcast = 0;
};
};