mirror of https://github.com/OpenTTD/OpenTTD
(svn r12190) -Fix [FS#1786](r8080): YAPF always shows 0ms PF time in debug for debug level 2 (patch by IguannaB)
parent
169ac7c91d
commit
2b8d1bcb51
|
@ -138,10 +138,11 @@ public:
|
||||||
|
|
||||||
#ifndef NO_DEBUG_MESSAGES
|
#ifndef NO_DEBUG_MESSAGES
|
||||||
perf.Stop();
|
perf.Stop();
|
||||||
if (_debug_yapf_level >= 3) {
|
if (_debug_yapf_level >= 2) {
|
||||||
int t = perf.Get(1000000);
|
int t = perf.Get(1000000);
|
||||||
_total_pf_time_us += t;
|
_total_pf_time_us += t;
|
||||||
|
|
||||||
|
if (_debug_yapf_level >= 3) {
|
||||||
UnitID veh_idx = (m_veh != NULL) ? m_veh->unitnumber : 0;
|
UnitID veh_idx = (m_veh != NULL) ? m_veh->unitnumber : 0;
|
||||||
char ttc = Yapf().TransportTypeChar();
|
char ttc = Yapf().TransportTypeChar();
|
||||||
float cache_hit_ratio = (m_stats_cache_hits == 0) ? 0.0f : ((float)m_stats_cache_hits / (float)(m_stats_cache_hits + m_stats_cost_calcs) * 100.0f);
|
float cache_hit_ratio = (m_stats_cache_hits == 0) ? 0.0f : ((float)m_stats_cache_hits / (float)(m_stats_cache_hits + m_stats_cost_calcs) * 100.0f);
|
||||||
|
@ -154,6 +155,7 @@ public:
|
||||||
m_perf_ts_cost.Get(1000000), m_perf_other_cost.Get(1000000)
|
m_perf_ts_cost.Get(1000000), m_perf_other_cost.Get(1000000)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* !NO_DEBUG_MESSAGES */
|
#endif /* !NO_DEBUG_MESSAGES */
|
||||||
return bDestFound;
|
return bDestFound;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue