Alternative to waiting in a method with a while loop
<p>I'm writing a program that runs through my method possibly 50 times a second or more (necessary)</p>

<p>The method needs to follow this model:</p>

<ul>
<li>Create boolean value.</li>
<li>Wait until the value changes.</li>
<li>Continue on in the method.</li>
</ul>

<p>Simple, I know, but I don't want to use a <code>while</code> loop because it takes up 3% or so CPU more than it should, and I imagine, should I need it to wait any longer for the value to change, that could take up all of my CPU cycles, which I don't want. Also, creating a new thread for every time I execute the method at 50 times per second is a horrible idea.</p>

<p>So what could I do? If I need to provide any other kind of information feel free to ask.</p>
