mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed excessively high CPU load
This commit is contained in:
@@ -88,7 +88,7 @@ extern "C" DllExport int coreFrame(lua_State* L)
|
||||
frameCounter++;
|
||||
|
||||
const std::chrono::duration<double> executionDuration = std::chrono::system_clock::now() - lastExecution;
|
||||
if (executionDuration.count() > FRAMERATE_TIME_INTERVAL) {
|
||||
if (executionDuration.count() > (20 * FRAMERATE_TIME_INTERVAL)) {
|
||||
if (executionDuration.count() > 0) {
|
||||
scheduler->setFrameRate(frameCounter / executionDuration.count());
|
||||
frameCounter = 0;
|
||||
|
||||
@@ -330,7 +330,7 @@ void Server::task()
|
||||
.then([&listener]() {log("RESTServer starting to listen"); })
|
||||
.wait();
|
||||
|
||||
while (runListener);
|
||||
while (runListener) { Sleep(1000); };
|
||||
|
||||
listener.close()
|
||||
.then([&listener]() {log("RESTServer stopping connections"); })
|
||||
|
||||
Reference in New Issue
Block a user