mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +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.
|
// Remove this check when real-time ctxUsage contruction is implemented.
|
||||||
if( !m_data.ctxUsage.empty() )
|
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;
|
if( it == m_data.ctxUsage.begin() || it == m_data.ctxUsage.end() ) return;
|
||||||
--it;
|
--it;
|
||||||
own = it->Own();
|
own = it->Own();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user