Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created February 18, 2017 21:00
Show Gist options
  • Save bangonkali/5b6c9387819cd884d70711a8510ac183 to your computer and use it in GitHub Desktop.
Save bangonkali/5b6c9387819cd884d70711a8510ac183 to your computer and use it in GitHub Desktop.
Simple Dispatch Queue
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