0
0
mirror of https://github.com/yse/easy_profiler.git synced 2025-01-14 00:27:55 +08:00

Update README

This commit is contained in:
Sergey Yagovtsev 2016-09-07 22:12:25 +03:00
parent 2cff79886d
commit 3ca2f9bc6e

View File

@ -54,22 +54,28 @@ This code snippet will generate block with function name and grouped it in Magen
#include <profiler/profiler.h>
void frame(){
PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Magenta);
EASY_FUNCTION(profiler::colors::Magenta);
prepareRender();
calculatePhysics();
}
```
To profile any block you may do this as following:
To profile any block you may do this as following. You can specify these blocks also with Google material design color or just set name of block (in this case color will be OrangeA100):
```cpp
#include <profiler/profiler.h>
void frame(){
//some code
PROFILER_BEGIN_BLOCK("Calculating summ");
EASY_BLOCK("Calculating summ");
for(int i = 0; i < 10; i++){
sum += i;
}
PROFILER_END_BLOCK;
EASY_END_BLOCK;
EASY_BLOCK("Calculating multiplication", profiler::colors::Blue50);
for(int i = 0; i < 10; i++){
mul *= i;
}
EASY_END_BLOCK;
}
```
[![Analytics](https://ga-beacon.appspot.com/UA-82899176-1/easy_profiler/readme)](https://github.com/yse/easy_profiler)