Created
February 18, 2017 21:00
-
-
Save bangonkali/5b6c9387819cd884d70711a8510ac183 to your computer and use it in GitHub Desktop.
Simple Dispatch Queue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DispatchQueue.global(qos: .background).async { | |
var x:Int = 0 | |
while (x < Int.max){ | |
x+=1 | |
var y:Int = 0 | |
while (y < Int.max){ | |
y+=1 | |
if (y % 10000 == 0){ | |
DispatchQueue.main.async { | |
self.numbers.text = "value x:\(x) y:\(y)}" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment