Infinite looping consumes 100% CPU
问题 I am stuck in a situation where I need to generate a defined frequency of some Hz. I have tried multimedia timers and all other stuff available on the internet but so far an infinite loop with some if-else conditions gave me the best results. But the problem in this approach is that it consumes almost all of the cpu leaving no space for other applications to work properly. I need an algorithm with either generates frequency of some Hz to KHz. I am using windows plateform with C#. 回答1: You can