diff --git a/native/cocos/platform/linux/LinuxPlatform.cpp b/native/cocos/platform/linux/LinuxPlatform.cpp index 05d01d70c7..0ed8af73bf 100644 --- a/native/cocos/platform/linux/LinuxPlatform.cpp +++ b/native/cocos/platform/linux/LinuxPlatform.cpp @@ -189,7 +189,7 @@ int32_t LinuxPlatform::loop() { onResume(); while (!_quit) { curTime = getCurrentMillSecond(); - desiredInterval = (long)(1.0 / getFps()); + desiredInterval = static_cast(1000.0 / getFps()); pollEvent(); actualInterval = curTime - lastTime; if (actualInterval >= desiredInterval) { diff --git a/native/cocos/platform/qnx/QNXPlatform.cpp b/native/cocos/platform/qnx/QNXPlatform.cpp index c84306a0e2..8ae44550df 100644 --- a/native/cocos/platform/qnx/QNXPlatform.cpp +++ b/native/cocos/platform/qnx/QNXPlatform.cpp @@ -189,9 +189,9 @@ int32_t QnxPlatform::loop() { onResume(); while (!_quit) { curTime = getCurrentMillSecond(); - desiredInterval = (long)(1.0 / getFps()); - - //pollEvent(); + desiredInterval = static_cast(1000.0 / getFps()); + + // pollEvent(); actualInterval = curTime - lastTime; if (actualInterval >= desiredInterval) { lastTime = getCurrentMillSecond();