I have a weird question... Given a while(True) loop, how can I make it run faster? Are there any ways or does this just depend on the amount of code taht's executed each time?
03/09/2021, 1:28 AM
if you have a lot of other processes running on your machine, your CPU might be balancing load between all of them. You could stop the processes, or use your OS to mark your thread as higher priority.
(But this probably isn't the case - OSs are pretty smart at this stuff.)
You could also parallelize your code and get it to run on multiple cores of your CPU.