Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created November 15, 2018 19:19
Show Gist options
  • Save vialyx/115cd1a6816e3c1544eb246d5b68b215 to your computer and use it in GitHub Desktop.
Save vialyx/115cd1a6816e3c1544eb246d5b68b215 to your computer and use it in GitHub Desktop.
let background = DispatchQueue.init(label: "background", qos: .background)
// Work takes significant time, such as minutes or hours.
let utility = DispatchQueue.init(label: "utility", qos: .utility)
// Work takes a few seconds to a few minutes.
let `default` = DispatchQueue.init(label: "default", qos: .default)
// The priority level of this QoS falls between user-initiated and utility. This QoS is not intended to be used by developers to classify work. Work that has no QoS information assigned is treated as default, and the GCD global queue runs at this level.
let userInitiated = DispatchQueue.init(label: "userInitiated", qos: .userInitiated)
// Work is nearly instantaneous, such as a few seconds or less.
let userInteractive = DispatchQueue.init(label: "userInteractive", qos: .userInteractive)
// Work is virtually instantaneous.
let unspecified = DispatchQueue.init(label: "unspecified", qos: .unspecified)
// This represents the absence of QoS information and cues the system that an environmental QoS should be inferred. Threads can have an unspecified QoS if they use legacy APIs that may opt the thread out of QoS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment