Is it normal that CPU usage exceeds 100% using dispatch async in Xcode 7
<p>I'm a beginner in swift 2, and I'm trying to make my program blocks while showing only a progress spinner until some operation finishes, I made that code snippet in a button with the action "touch up inside", my problem is that while debugging,Xcode 7 CPU usage jumps to 190 % once I tap my button and keeps high until the flag changes its value, Is it normal that CPU usage jumps like that?, also Is it a good practice to use the following snippet or shud i use sleep or some other mechanism inside my infinite loop?</p>

<pre><code>let queue2 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
            dispatch_async(self.queue2) { () -&gt; Void in
            while(flag == true)
            {
                //wait until flag sets to false from previous func
            }
            self.dispatch_main({ 

                 //continue after the flag became false
})
</code></pre>