mirror of
https://github.com/wolfpld/tracy
synced 2025-04-28 20:23:51 +00:00
Directly compare time, with data piggybacked in low bits.
This commit is contained in:
parent
a688d24665
commit
0e6a25fdd8
@ -2028,7 +2028,8 @@ void Worker::GetCpuUsageAtTime( int64_t time, int& own, int& other ) const
|
||||
// Remove this check when real-time ctxUsage contruction is implemented.
|
||||
if( !m_data.ctxUsage.empty() )
|
||||
{
|
||||
auto it = std::upper_bound( m_data.ctxUsage.begin(), m_data.ctxUsage.end(), time, [] ( const auto& l, const auto& r ) { return l < r.Time(); } );
|
||||
const auto test = ( time << 16 ) | 0xFFFF;
|
||||
auto it = std::upper_bound( m_data.ctxUsage.begin(), m_data.ctxUsage.end(), test, [] ( const auto& l, const auto& r ) { return l < r._time_other_own; } );
|
||||
if( it == m_data.ctxUsage.begin() || it == m_data.ctxUsage.end() ) return;
|
||||
--it;
|
||||
own = it->Own();
|
||||
|
Loading…
x
Reference in New Issue
Block a user