I am using URLSessionDataTask on watchOS 4, tested on Xcode 9 Simulator and Apple Watch Series 2 42mm. This is the code:
let ts = Date()
let task = urlSession.dataTask(with: urlRequest, completionHandler: {
[weak self] data, response, error in
self?.log(executionSince: ts, "URLSessionDataTask completed")
....
})
}
The network request executes in 20-50ms, I checked and re-checked using network proxy.
However, the time difference between calling the dataTask and the moment it calls its completion handler is 6-10 seconds. That sounds pretty ludicrious and I'm not sure what I can do to improve it. This can't be normal behavior...
I have looked around the forums and found this thread from 2015, which I don't know what to do with.