What if I have nested loops, and I want to break out of all of them at once?
while (true) { // ... while (shouldCont) { // ... while (sho
If you want to break out of an entire method, then use the code below. If you only want to break out of a series of loops within a method without breaking out of the method, then one of the answers that have already been posted will do the job.
if (TimeToStop) { return; }