From 1c3cd4a7d51758dfd332ce1a3f7546ab8050f294 Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Tue, 16 Jul 2019 15:59:57 +0800 Subject: [PATCH] fix profiler frame time (#4884) --- cocos/core/utils/profiler/profiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/core/utils/profiler/profiler.ts b/cocos/core/utils/profiler/profiler.ts index 3d387c6103..e80e46cfec 100644 --- a/cocos/core/utils/profiler/profiler.ts +++ b/cocos/core/utils/profiler/profiler.ts @@ -231,6 +231,7 @@ function beforeUpdate () { generateNode(); const now = cc.director._lastUpdate; + getCounter('frame').end(now); getCounter('frame').start(now); getCounter('logic').start(now); } @@ -286,7 +287,6 @@ function afterDraw () { const now = performance.now(); - getCounter('frame').end(now); getCounter('fps').frame(now); getCounter('draws').value = device!.numDrawCalls; getCounter('bufferMemory').value = device!.memoryStatus.bufferSize;