Small code cleanup for PerformanceTimer

This commit is contained in:
verysecrethero
2016-02-17 13:44:41 +01:00
parent b2a437731e
commit 833015f45e
3 changed files with 13 additions and 23 deletions
-4
View File
@@ -1,10 +1,7 @@
#ifndef PerformanceTimer_h__
#define PerformanceTimer_h__
#include <array>
#include <GLFW/glfw3.h>
#include "../Common.h"
#include <boost/timer/timer.hpp>
using boost::timer::cpu_timer;
@@ -21,7 +18,6 @@ public:
private:
static std::map<std::string, cpu_timer> timers;
static double m_TimeElapsed;
static cpu_timer m_Timer;
static std::string currentTimerRunning;
};
+10 -10
View File
@@ -5019,7 +5019,7 @@
</Team>
</c:Team>
<c:Transform>
<Position X="-60.3695679" Y="2.14482641" Z="-79.3789597"/>
<Position X="-60.3695679" Y="4.44500017" Z="-79.3789597"/>
</c:Transform>
</Components>
<Children>
@@ -5089,7 +5089,7 @@
</Team>
</c:Team>
<c:Transform>
<Position X="60.0169258" Y="2.37972379" Z="76.2893906"/>
<Position X="60.0169258" Y="5.78000021" Z="76.2893906"/>
</c:Transform>
</Components>
<Children>
@@ -5165,7 +5165,7 @@
<c:Transform>
<Position X="48.9189453" Y="7.06223536" Z="-78.9347992"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="71.4059677" Z="0"/>
<Orientation X="0" Y="74.8370514" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5184,7 +5184,7 @@
<c:Transform>
<Position X="-59.3499641" Y="7.46932745" Z="-20.6276321"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="68.0603104" Z="0"/>
<Orientation X="0" Y="71.491394" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5203,7 +5203,7 @@
<c:Transform>
<Position X="-1.13644195" Y="1.38919806" Z="38.9768829"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="65.6683426" Z="0"/>
<Orientation X="0" Y="69.0994263" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5222,7 +5222,7 @@
<c:Transform>
<Position X="54.7225227" Y="6.51863909" Z="29.0052128"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="65.9822693" Z="0"/>
<Orientation X="0" Y="69.413353" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5241,7 +5241,7 @@
<c:Transform>
<Position X="-51.6792374" Y="8.44526482" Z="32.5153465"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="65.4309921" Z="0"/>
<Orientation X="0" Y="68.8620758" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5260,7 +5260,7 @@
<c:Transform>
<Position X="-42.3974304" Y="7.28327894" Z="81.9305344"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="63.560215" Z="0"/>
<Orientation X="0" Y="66.9912949" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5279,7 +5279,7 @@
<c:Transform>
<Position X="-9.85184956" Y="8.25567532" Z="39.6119232"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="62.6090584" Z="0"/>
<Orientation X="0" Y="66.0401306" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
@@ -5298,7 +5298,7 @@
<c:Transform>
<Position X="49.2257118" Y="7.39368248" Z="-31.1810112"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
<Orientation X="0" Y="59.8201942" Z="0"/>
<Orientation X="0" Y="63.2512436" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
+3 -9
View File
@@ -1,11 +1,8 @@
#include "Core/PerformanceTimer.h"
#include <iostream>
#include <ctime>
#include <fstream>
#include <Windows.h>
cpu_timer PerformanceTimer::m_Timer;
double PerformanceTimer::m_TimeElapsed;
std::map<std::string, cpu_timer> PerformanceTimer::timers;
std::string PerformanceTimer::currentTimerRunning = "";
@@ -50,16 +47,13 @@ void PerformanceTimer::ResetAllTimers()
void PerformanceTimer::CreateExcelData()
{
//get path,time
char Dump_Path[MAX_PATH];
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process
//get time
std::time_t t = std::time(NULL);
char tStr[16];
std::strftime(tStr, 32, " %a %H-%M-%S", std::localtime(&t));
std::string time(tStr);
std::string path(Dump_Path);
path = path.substr(0, path.length() - 4);
path += time + ".xls";
std::string path("TacticalZ");
path += time + ".csv";
std::ofstream someFileStream;
someFileStream.open(path, std::ofstream::out);
someFileStream << "classname" << ',' << "walltime" << ',' << "userTime" << ',' << "systemTime" << '\n';