mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
example performance: improve to print average...
This commit is contained in:
parent
db85313328
commit
749a0fbb54
1 changed files with 6 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
static tvg::Picture* pPicture = nullptr;
|
||||
static double updateTime = 0;
|
||||
static double accumulateTime = 0;
|
||||
static uint cnt = 0;
|
||||
|
||||
void tvgDrawCmds(tvg::Canvas* canvas)
|
||||
|
@ -99,7 +100,11 @@ void drawSwView(void* data, Eo* obj)
|
|||
|
||||
auto rasterTime = after - before;
|
||||
|
||||
printf("[%5d]: rendering = %fs\n", ++cnt, updateTime + rasterTime);
|
||||
++cnt;
|
||||
|
||||
accumulateTime += (updateTime + rasterTime);
|
||||
|
||||
printf("[%5d]: rendering = %fs, average = %fs\n", cnt, updateTime + rasterTime, accumulateTime / cnt);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue