Skip to content

Commit

Permalink
fix duration
Browse files Browse the repository at this point in the history
  • Loading branch information
PatriceJiang committed Nov 9, 2023
1 parent 18ec4dd commit 6fd8f65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions native/cocos/platform/android/adpf_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "adpf_manager.h"
#include "platform/BasePlatform.h"

#if CC_PLATFORM == CC_PLATFORM_ANDROID && __ANDROID_API__ >= 30

Expand Down Expand Up @@ -69,10 +70,9 @@ void ADPFManager::Initialize() {
});

afterTick.bind([&]() {
auto frameDuration = std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::milliseconds(16))
.count();
this->EndPerfHintSession(frameDuration);
auto fps = cc::BasePlatform::getPlatform()->getFps();
auto frameDurationNS = 1000000000LL / fps;
this->EndPerfHintSession(frameDurationNS);
});

if (thermal_manager_) {
Expand Down

0 comments on commit 6fd8f65

Please sign in to comment.