Retrieval of last recorded event's time.

This commit is contained in:
Bartosz Taudul 2017-09-18 02:22:59 +02:00
parent 3eb17e9969
commit b259dc94f8
2 changed files with 14 additions and 0 deletions

View File

@ -299,6 +299,18 @@ void View::UpdateZone( Event* zone )
assert( zone->end != -1 ); assert( zone->end != -1 );
} }
uint64_t View::GetLastTime()
{
uint64_t last = 0;
if( !m_frames.empty() ) last = m_frames.back();
if( !m_timeline.empty() )
{
auto ev = m_timeline.back();
if( ev->end > (int64_t)last ) last = ev->end;
}
return last;
}
void View::Draw() void View::Draw()
{ {
s_instance->DrawImpl(); s_instance->DrawImpl();

View File

@ -48,6 +48,8 @@ private:
void NewZone( Event* zone ); void NewZone( Event* zone );
void UpdateZone( Event* zone ); void UpdateZone( Event* zone );
uint64_t GetLastTime();
void DrawImpl(); void DrawImpl();
std::string m_addr; std::string m_addr;