|
|
|
|
|
by CyberDildonics
2870 days ago
|
|
That's a very amateurish way to solve this problem. Games typically have a main loop which will check the amount of time that has passed on every iteration of the loop. You can see how much extra time is left for that frame at the targeted frame rate, then sleep for that amount of time. Then you never have to slow down anything else, you can set a maximum amount of cycles per second and you can sleep once per cycle. The faster the CPU, the less power it should use. |
|
https://www.youtube.com/watch?v=dmWQtI3DFFo