improved performance using my own tga load function always instead of QImage
improved Profiler
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user