Long method

func async(_ runner: @escaping @autoclosure () ->())
{
    DispatchQueue.global(qos: .default).async {
        runner()
    }
}

func longMethod() {
    for _ in 1...2 {
        sleep(5)
    }
    print("run like a boss")
}
async(longMethod())

Tags: