Fix fps calculation error for linux and QNX (#10141)

This commit is contained in:
qiuguohua
2022-02-22 09:57:24 +08:00
committed by GitHub
parent ab939cefdf
commit c082902fe4
2 changed files with 4 additions and 4 deletions
@@ -189,7 +189,7 @@ int32_t LinuxPlatform::loop() {
onResume();
while (!_quit) {
curTime = getCurrentMillSecond();
desiredInterval = (long)(1.0 / getFps());
desiredInterval = static_cast<long>(1000.0 / getFps());
pollEvent();
actualInterval = curTime - lastTime;
if (actualInterval >= desiredInterval) {
+3 -3
View File
@@ -189,9 +189,9 @@ int32_t QnxPlatform::loop() {
onResume();
while (!_quit) {
curTime = getCurrentMillSecond();
desiredInterval = (long)(1.0 / getFps());
//pollEvent();
desiredInterval = static_cast<long>(1000.0 / getFps());
// pollEvent();
actualInterval = curTime - lastTime;
if (actualInterval >= desiredInterval) {
lastTime = getCurrentMillSecond();