Skip to content

Instantly share code, notes, and snippets.

@vialyx
Last active November 15, 2018 19:07
Show Gist options
  • Save vialyx/4a2c994af0b8ba0c409181a2824ba375 to your computer and use it in GitHub Desktop.
Save vialyx/4a2c994af0b8ba0c409181a2824ba375 to your computer and use it in GitHub Desktop.
DispatchQueue.init(label: "defaultQos").sync {
print("sync defaultQos exec")
// 1
}
DispatchQueue.init(label: "defaultQos").async {
print("async defaultQos exec")
// 3
}
print("sync main exec")
// 2
/* console output
sync defaultQos exec
sync main exec
async defaultQos exec
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment