Add frame time accessors.

This commit is contained in:
Bartosz Taudul 2017-09-20 22:34:56 +02:00
parent edb7fac230
commit ef317fa2be
2 changed files with 20 additions and 0 deletions

View File

@ -323,6 +323,24 @@ uint64_t View::GetFrameTime( size_t idx ) const
}
}
uint64_t View::GetFrameBegin( size_t idx ) const
{
assert( idx < m_frames.size() );
return m_frames[idx];
}
uint64_t View::GetFrameEnd( size_t idx ) const
{
if( idx < m_frames.size() - 1 )
{
return m_frames[idx+1];
}
else
{
return GetLastTime();
}
}
uint64_t View::GetLastTime() const
{
uint64_t last = 0;

View File

@ -49,6 +49,8 @@ private:
void UpdateZone( Event* zone );
uint64_t GetFrameTime( size_t idx ) const;
uint64_t GetFrameBegin( size_t idx ) const;
uint64_t GetFrameEnd( size_t idx ) const;
uint64_t GetLastTime() const;
const char* TimeToString( uint64_t ns ) const;