improved performance using my own tga load function always instead of QImage

improved Profiler
This commit is contained in:
Anakin
2017-01-30 16:00:14 +01:00
parent d1c68e8ba6
commit 4342260e6d
4 changed files with 125 additions and 119 deletions

View File

@@ -2,9 +2,10 @@
#ifdef _DEBUG
#include <QElapsedTimer.h>
#include <QString>
#include <iostream>
#define TIC Profiler::getInstance().startTimer();
#define TOC Profiler::getInstance().takeTime();
#define TIC(val) Profiler::getInstance().startTimer(val);
#define TOC(val) Profiler::getInstance().takeTime(val);
class Profiler
{
@@ -21,16 +22,17 @@
return instance;
}
void startTimer() {
void startTimer(QString position = "") {
std::cout << "from: " << position.toStdString() << std::endl;
timer.restart();
};
void takeTime() {
std::cout << "time elapsed: " << timer.elapsed() << std::endl;
void takeTime(QString position = "") {
std::cout << "to: "<< position.toStdString() << " time elapsed: " << timer.elapsed() << std::endl;
};
};
#else
#define TIC
#define TOC
#define TIC(val)
#define TOC(val)
#endif