mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Don't need to keep last broadcast time in Profiler class.
This commit is contained in:
parent
99e638b3fc
commit
0b394c3f53
@ -1110,6 +1110,7 @@ void Profiler::Worker()
|
|||||||
|
|
||||||
const char* broadcastMsg = nullptr;
|
const char* broadcastMsg = nullptr;
|
||||||
int broadcastLen = 0;
|
int broadcastLen = 0;
|
||||||
|
uint64_t lastBroadcast = 0;
|
||||||
#ifndef TRACY_NO_BROADCAST
|
#ifndef TRACY_NO_BROADCAST
|
||||||
m_broadcast = (UdpBroadcast*)tracy_malloc( sizeof( UdpBroadcast ) );
|
m_broadcast = (UdpBroadcast*)tracy_malloc( sizeof( UdpBroadcast ) );
|
||||||
new(m_broadcast) UdpBroadcast();
|
new(m_broadcast) UdpBroadcast();
|
||||||
@ -1149,9 +1150,9 @@ void Profiler::Worker()
|
|||||||
if( m_broadcast )
|
if( m_broadcast )
|
||||||
{
|
{
|
||||||
auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count();
|
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 );
|
m_broadcast->Send( 8087, broadcastMsg, broadcastLen );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -552,8 +552,6 @@ private:
|
|||||||
#else
|
#else
|
||||||
void ProcessSysTime() {}
|
void ProcessSysTime() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t m_lastBroadcast = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user