MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / writeCSV

Function writeCSV

src/openrct2/profiling/Profiling.cpp:202–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 namespace
201 {
202 bool writeCSV(const std::string& filePath)
203 {
204 std::ofstream out(filePath);
205 if (!out.is_open())
206 return false;
207
208 out << std::setprecision(12);
209 out << "function_name,calls,min_microseconds,max_microseconds,average_microseconds,total_microseconds\n";
210
211 std::scoped_lock lock(Detail::getRegistryMutex());
212
213 for (const auto* func : Detail::getRegistry())
214 {
215 out << "\"" << func->getName() << "\",";
216 out << func->getCallCount() << ",";
217 out << func->getMinTime() << ",";
218 out << func->getMaxTime() << ",";
219 out << func->getAverageTime() << ",";
220 out << func->getTotalTime() << "\n";
221 }
222
223 return true;
224 }
225
226 bool writeJSON(const std::string& filePath)
227 {

Callers 1

exportDataFunction · 0.85

Calls 6

getCallCountMethod · 0.80
getMinTimeMethod · 0.80
getMaxTimeMethod · 0.80
getAverageTimeMethod · 0.80
getNameMethod · 0.45
getTotalTimeMethod · 0.45

Tested by

no test coverage detected