mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix server mainloop
This commit is contained in:
parent
6eeb7a81d9
commit
0bbd215ab7
1 changed files with 5 additions and 2 deletions
|
|
@ -65,8 +65,11 @@ void ServerMainloop::run() {
|
|||
|
||||
if (!coreParams.testMode) {
|
||||
auto end = system_clock::now();
|
||||
platform::sleep(targetDelta * 1000 -
|
||||
duration_cast<microseconds>(end - begin).count() / 1000);
|
||||
int64_t millis = targetDelta * 1000 -
|
||||
duration_cast<microseconds>(end - begin).count() / 1000;
|
||||
if (millis > 0) {
|
||||
platform::sleep(millis);
|
||||
}
|
||||
begin = system_clock::now();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue