C# Wait until condition is true

后端 未结 7 1596
暖寄归人
暖寄归人 2020-12-24 05:52

I am trying to write a code that executes when a condition is met. Currently, I am using while...loop, which I know is not very efficient. I am also looking at AutoResetEven

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 06:07

    you can use SpinUntil which is buildin in the .net-framework. Please note: This method causes high cpu-workload.

提交回复
热议问题