mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Broadcast client activity time.
This commit is contained in:
parent
1a32edebf2
commit
5309e6d94a
@ -1143,10 +1143,12 @@ void Profiler::Worker()
|
||||
|
||||
if( m_broadcast )
|
||||
{
|
||||
auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count();
|
||||
const auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count();
|
||||
if( t - lastBroadcast > 3000000000 ) // 3s
|
||||
{
|
||||
lastBroadcast = t;
|
||||
const auto ts = std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
|
||||
broadcastMsg.activeTime = ts - m_epoch;
|
||||
m_broadcast->Send( 8086, &broadcastMsg, broadcastLen );
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ struct BroadcastMessage
|
||||
{
|
||||
uint32_t broadcastVersion;
|
||||
uint32_t protocolVersion;
|
||||
uint32_t activeTime; // in seconds
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user