Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2016 14:12
Show Gist options
  • Select an option

  • Save anonymous/183d599ea299cea6779809da7ca7944c to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/183d599ea299cea6779809da7ca7944c to your computer and use it in GitHub Desktop.
QueueThreads
import Cocoa
class ViewController: NSViewController {
var queue = DispatchQueue(label: "Queue", qos: .background, attributes: .concurrent)
override func viewDidLoad() {
super.viewDidLoad()
(0..<1000).forEach { i in self.queue.async { Thread.sleep(forTimeInterval: 30.0) } }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment