mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-07-14 10:44:30 +00:00
add Util.DebugExecutionTime
This commit is contained in:
+10
-1
@@ -36,6 +36,15 @@ void prof::UnitExecutionTime::add_sample(const Duration& dur) {
|
||||
}
|
||||
|
||||
prof::UnitExecutionTime::UnitExecutionTime()
|
||||
: m_measurements(boost::circular_buffer<Duration>(16)) {
|
||||
: m_measurements(boost::circular_buffer<Duration>(100)) {
|
||||
}
|
||||
|
||||
std::unordered_map<std::string, double> prof::UnitProfileCollection::all_average_durations() {
|
||||
auto map = m_map.synchronize();
|
||||
std::unordered_map<std::string, double> result {};
|
||||
for (const auto& [name, time] : *map) {
|
||||
result[name] = time.average_duration().count();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user