1 // ProfileLogHandler.cpp: implementation of the CProfileLogHandler class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
6 #include "ProfileLogHandler.h"
\r
8 //////////////////////////////////////////////////////////////////////
\r
9 // Construction/Destruction
\r
10 //////////////////////////////////////////////////////////////////////
\r
12 void CProfileLogHandler::BeginOutput(float tTime)
\r
14 CLog::Get().Write(LOG_APP,IDS_PROFILE_HEADER1,tTime, 60.0f/tTime);
\r
15 CLog::Get().Write(LOG_APP,IDS_PROFILE_HEADER2);
\r
18 void CProfileLogHandler::Sample(float fMin, float fAvg, float fMax, float tAvg, int callCount, std::string name, int parentCount)
\r
21 //for(int i=0;i<parentCount;i++){szBuf[i]=' ';}
\r
22 //szBuf[parentCount]=0;
\r
23 char namebuf[256], indentedName[256];
\r
24 char avg[16], min[16], max[16], num[16], time[16];
\r
26 sprintf_s(avg,16, "%3.1f", fAvg);
\r
27 sprintf_s(min,16, "%3.1f", fMin);
\r
28 sprintf_s(max,16, "%3.1f", fMax);
\r
29 sprintf_s(time,16,"%3.1f", tAvg);
\r
30 sprintf_s(num,16, "%3d", callCount);
\r
32 strcpy_s( indentedName,256, name.c_str());
\r
33 for( int indent=0; indent<parentCount; ++indent )
\r
35 sprintf_s(namebuf,256, " %s", indentedName);
\r
36 strcpy_s( indentedName,256, namebuf);
\r
39 CLog::Get().Write(LOG_APP,IDS_PROFILE_SAMPLE,min,avg,max,time,num,indentedName);
\r
42 void CProfileLogHandler::EndOutput()
\r
44 CLog::Get().Write(LOG_APP,"\n");
\r