1 class SCR_TimeMeasurementHelper
27 protected ref map<string, ref SCR_TimeMeasurementHelper_Info> m_mData;
32 void BeginMeasure(
string name)
34 SCR_TimeMeasurementHelper_Info info = m_mData.Get(name);
37 info =
new SCR_TimeMeasurementHelper_Info();
38 m_mData.Insert(name, info);
41 info.m_fStart = System.GetTickCount();
48 void EndMeasure(
string name)
50 SCR_TimeMeasurementHelper_Info info = m_mData.Get(name);
53 Print(
"No measurement named \"" + name +
"\" was found", LogLevel.WARNING);
57 info.m_fTotal += System.GetTickCount(info.m_fStart);
65 float GetMeasure(
string name)
67 SCR_TimeMeasurementHelper_Info info = m_mData.Get(name);
70 Print(
"No measurement named \"" + name +
"\" was found", LogLevel.WARNING);
79 void PrintAllMeasures()
81 foreach (
string name, SCR_TimeMeasurementHelper_Info info : m_mData)
83 Print(
"Measure \"" + name +
"\": " + info.m_fTotal +
" ms", LogLevel.NORMAL);
96 void SCR_TimeMeasurementHelper()
98 m_mData =
new map<string, ref SCR_TimeMeasurementHelper_Info>();
103 class SCR_TimeMeasurementHelper_Info