- Compiler must support C++ 11 or above.
- Create new folder Build(or whatever you like)
- cd(enter) the new folder
- $ cmake ..(where CMakeLists.txt is)
###Example for MEASURE_BLOCK
#include <iostream>
#include <thread>
#include "measure_time.h"
void TestFunction1()
{
MEASURE_BLOCK
std::this_thread::sleep_for(std::chrono::seconds(5));
}
int main(int argc, const char*argv[])
{
TestFunction1();
return 0;
}
###Possible Output
Fri Jul 29 11:35 : 10 2016 >> [Function] TestFunction1 : 5000 ms
###Example for MEASURE_START/MEASURE_END
#include <iostream>
#include <thread>
#include "measure_time.h"
void TestFunction2()
{
MEASURE_START(procedure1)
std::this_thread::sleep_for(std::chrono::seconds(5));
}
void TestFunction3()
{
std::this_thread::sleep_for(std::chrono::seconds(5));
MEASURE_END(procedure1)
}
int main(int argc, const char*argv[])
{
TestFunction2();
TestFunction3();
return 0;
}
###Possible Output
Fri Jul 29 11:35 : 10 2016 >> [Tag] procedure1 : 10000 ms
The measure-time project team welcomes contributions from the community. If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue when you open a Pull Request. For any questions about the CLA process, please refer to our FAQ. For more detailed information, refer to CONTRIBUTING.md.
GNU General Public License 2.0 (GPL 2.0)