Skip to content

Instantly share code, notes, and snippets.

@svd-zp
Forked from anonymous/QueueThreads.swift
Created March 15, 2017 13:33
Show Gist options
  • Select an option

  • Save svd-zp/39ecff1ff5963b1bf5e7e3766cc6ec5f to your computer and use it in GitHub Desktop.

Select an option

Save svd-zp/39ecff1ff5963b1bf5e7e3766cc6ec5f 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