In our render-loop we've always had a FPS limiter in the form of this_thread::sleep_until(Thisframe + milliseconds(1000 / 60));
but after compiling on the latest version the FPS never went above 32. So played around with the delay and found that any sleep >= 1 micro-second added 5-16ms. Anyone else noticed something similar?
// std::this_thread::sleep_for(std::chrono::nanoseconds(N));
------------------------------------------------------------
N | Max (ns) | Avg (ns) | Min (ns)
------------------------------------------------------------
1 541 532 530
10 526 526 523
100 526 526 525
1'000 5'105'253 5'035'142 4'945'181
10'000 15'849'245 15'829'724 15'751'297
100'000 15'900'155 15'884'466 15'846'923
1'000'000 15'885'041 15'877'936 15'872'767
10'000'000 15'899'457 15'884'640 15'881'723
// std::this_thread::sleep_for(std::chrono::nanoseconds(N));
------------------------------------------------------------
N | Avg (ns)
------------------------------------------------------------
3'000 17'759'597
2'500 13'888'173
2'000 10'093'005
1'500 9'393'417
1'000 4'735'949
750 2'841'692
700 5'445'165
650 4'658'634
600 2'153
500 1'789