mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
Count ticks in nanoseconds.
This commit is contained in:
parent
dfa4e8e7d2
commit
ac1a1dd8a7
2 changed files with 5 additions and 5 deletions
|
@ -39,7 +39,7 @@ void CProfiler::EnterZone(ZoneHandle zoneHandle)
|
|||
if(!m_zoneStack.empty())
|
||||
{
|
||||
auto topZoneHandle = m_zoneStack.top();
|
||||
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(thisTime - m_currentTime);
|
||||
auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(thisTime - m_currentTime);
|
||||
AddTimeToZone(topZoneHandle, duration.count());
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ void CProfiler::ExitZone()
|
|||
|
||||
{
|
||||
auto topZoneHandle = m_zoneStack.top();
|
||||
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(thisTime - m_currentTime);
|
||||
auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(thisTime - m_currentTime);
|
||||
AddTimeToZone(topZoneHandle, duration.count());
|
||||
}
|
||||
|
||||
|
@ -88,11 +88,11 @@ void CProfiler::SetWorkThread()
|
|||
#endif
|
||||
}
|
||||
|
||||
void CProfiler::AddTimeToZone(ZoneHandle zoneHandle, uint64 timeUs)
|
||||
void CProfiler::AddTimeToZone(ZoneHandle zoneHandle, uint64 timeNs)
|
||||
{
|
||||
assert(m_zones.size() > zoneHandle);
|
||||
auto& zone = m_zones[zoneHandle];
|
||||
zone.totalTime += timeUs;
|
||||
zone.totalTime += timeNs;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue