In short it replaces this
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1)) {
//doing your work
}
with
delay(seconds: 1, thread: .main) {
//doing your work
}
and replaces this
DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + .seconds(1)) {
//doing your work
}
with
delay(seconds: 1, thread: .background(.default)) {
//doing your work
}