Created
December 9, 2016 14:12
-
-
Save anonymous/183d599ea299cea6779809da7ca7944c to your computer and use it in GitHub Desktop.
QueueThreads
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
| 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