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
you can use SpinUntil which is buildin in the .net-framework. Please note: This method causes high cpu-workload.