Add macro for easy generation of PerformanceHelper

This commit is contained in:
Alexander Bock
2016-06-06 07:09:54 +02:00
parent 55bd1341e6
commit 6af96c4ef3

View File

@@ -44,7 +44,13 @@ private:
std::chrono::high_resolution_clock::time_point _startTime;
};
#define __MERGE(a,b) a##b
#define __LABEL(a) __MERGE(unique_name_, a)
/// Declare a new variable for measuring the performance of the current block
#define PerformanceMeasurement(name) auto __LABEL(__LINE__) = openspace::performance::PerformanceHelper((name), OsEng.renderEngine().performanceManager())
} // namespace performance
} // namespace openspace