Created Custom dispatch queue and submitted two tasks to same queue and I gave sleep(3) for first task and sleep(1) for second task. then why first task completes execution first?
let queue = DispatchQueue(label: "name");
queue.async {
Thread.sleep(forTimeInterval: 3)
print("Task1 done")
}
queue.async {
Thread.sleep(forTimeInterval: 1)
print("Task2 done")
}