Small cleanup in the code

This commit is contained in:
verysecrethero
2016-02-16 17:58:27 +01:00
parent 42b49f9dba
commit b2a437731e
2 changed files with 2 additions and 14 deletions
-7
View File
@@ -19,18 +19,11 @@ public:
static void ResetAllTimers(); static void ResetAllTimers();
static void CreateExcelData(); static void CreateExcelData();
//set timer/start
//get performance excel nånting
private: private:
static std::map<std::string, cpu_timer> timers; static std::map<std::string, cpu_timer> timers;
static double m_TimeElapsed; static double m_TimeElapsed;
static cpu_timer m_Timer; static cpu_timer m_Timer;
static std::string currentTimerRunning; static std::string currentTimerRunning;
static bool active;
//static map
}; };
#endif #endif
+2 -7
View File
@@ -27,16 +27,12 @@ void PerformanceTimer::StartTimerAndStopPrevious(std::string nameOfTimer)
currentTimerRunning = nameOfTimer; currentTimerRunning = nameOfTimer;
} }
void PerformanceTimer::StopTimer(std::string nameOfTimer) void PerformanceTimer::StopTimer(std::string nameOfTimer)
{ {
timers[nameOfTimer].stop(); timers[nameOfTimer].stop();
currentTimerRunning = nameOfTimer; currentTimerRunning = nameOfTimer;
} }
void PerformanceTimer::SetFrameNumber(int frameNumber) void PerformanceTimer::SetFrameNumber(int frameNumber)
{ {
} }
@@ -54,9 +50,6 @@ void PerformanceTimer::ResetAllTimers()
void PerformanceTimer::CreateExcelData() void PerformanceTimer::CreateExcelData()
{ {
//wall = http://theboostcpplibraries.com/boost.timer
//http://www.boost.org/doc/libs/1_48_0/libs/timer/doc/cpu_timers.html
//get path,time //get path,time
char Dump_Path[MAX_PATH]; char Dump_Path[MAX_PATH];
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process
@@ -70,6 +63,8 @@ void PerformanceTimer::CreateExcelData()
std::ofstream someFileStream; std::ofstream someFileStream;
someFileStream.open(path, std::ofstream::out); someFileStream.open(path, std::ofstream::out);
someFileStream << "classname" << ',' << "walltime" << ',' << "userTime" << ',' << "systemTime" << '\n'; someFileStream << "classname" << ',' << "walltime" << ',' << "userTime" << ',' << "systemTime" << '\n';
//write all timers to file
for (auto aTimer : timers) for (auto aTimer : timers)
{ {
//remove the "class" name in front of the string //remove the "class" name in front of the string