2016-02-16 23:21:12 +03:00
|
|
|
#include "profiler/profiler.h"
|
2016-02-18 00:49:32 +03:00
|
|
|
#include <chrono>
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
void shortTimeFunction(){
|
|
|
|
PROFILER_BEGIN_FUNCTION_BLOCK;
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
|
|
|
}
|
|
|
|
|
|
|
|
void longTimeFunction(){
|
|
|
|
PROFILER_BEGIN_FUNCTION_BLOCK;
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-16 23:21:12 +03:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
|
|
|
|
//profiler::Block bl("sds");
|
|
|
|
|
|
|
|
//profiler::registerMark(&bl);
|
|
|
|
|
|
|
|
PROFILER_ENABLE;
|
|
|
|
PROFILER_BEGIN_BLOCK("block1");
|
|
|
|
PROFILER_ADD_MARK("mark1");
|
|
|
|
PROFILER_ADD_MARK_GROUPED("mark1",1);
|
|
|
|
PROFILER_DISABLE;
|
|
|
|
return 0;
|
2016-02-16 23:25:12 +03:00
|
|
|
}
|