MCPcopy Create free account
hub / github.com/beefytech/Beef / DbgPrint

Method DbgPrint

BeefySysLib/util/PerfTimer.cpp:22–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void PerfEntry::DbgPrint(const StringImpl& name, int level, std::map<String, int>& uniqueTimingMap)
23{
24 String text;
25
26 uint64 childrenTime = 0;
27
28 /*PerfEntryMap::iterator itr = mChildren.begin();
29 while (itr != mChildren.end())
30 {
31 PerfEntry* child = &itr->second;
32 childrenTime += child->mTimeTotal;
33 ++itr;
34 }*/
35
36 for (auto& kv : mChildren)
37 {
38 PerfEntry* child = kv.mValue;
39 childrenTime += child->mTimeTotal;
40 }
41
42 for (int i = 0; i <= level; i++)
43 text += " ";
44 String prefix = text;
45
46 text += name;
47
48 while (text.length() < 80)
49 text += ' ';
50
51 int selfTime = (int)(mTimeTotal - childrenTime);
52
53 if (uniqueTimingMap.find(name) == uniqueTimingMap.end())
54 uniqueTimingMap[name] = selfTime;
55 else
56 uniqueTimingMap[name] += selfTime;
57
58 text += StrFormat("%4d\t%6.1f\t%6.1f\n", mCount, mTimeTotal / 1000.0f, (int) (selfTime) / 1000.0f);
59
60 /*for (int i = 0; i < (int) mLog.size(); i++)
61 {
62 PerfLogEntry* logEntry = &mLog[i];
63 text += prefix + StrFormat("@%d: %s\n", logEntry->mTick, logEntry->mString.c_str());
64 }*/
65
66 OutputDebugStrF(text.c_str());
67
68 for (auto& kv : mChildren)
69 {
70 PerfEntry* child = kv.mValue;
71 child->DbgPrint(kv.mKey, level + 1, uniqueTimingMap);
72 }
73}
74
75void PerfManager::Clear()
76{

Callers 8

Res_DeletePSDReaderFunction · 0.80
ProcessMethod · 0.80
PerfTimer_DbgPrintFunction · 0.80
BfSystem_DbgPrintTimingsFunction · 0.80
ClassifyMethod · 0.80
AutocompleteMethod · 0.80

Calls 12

PerfFrameClass · 0.85
findMethod · 0.80
BfpThread_GetCurrentIdFunction · 0.50
lengthMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45
push_backMethod · 0.45
TryAddMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected