NetworkSpeedTester
public class NetworkSpeedTester : NSObject, URLSessionDelegate, URLSessionDataDelegate, URLSessionTaskDelegate
Network speed testing utility that measures download performance across multiple URLs.
-
Initiates speed testing across multiple URLs with real-time progress updates.
Declaration
Swift
public func startSpeedTest(urls: QualityURLSet, onProgress: @escaping (_ instantaneousMbps: Double, _ elapsedMs: TimeInterval) -> Void, completion: @escaping (_ speedInMbps: Double?, _ dnsTime: TimeInterval?, _ totalTime: TimeInterval?, _ error: Error?) -> Void)
-
Called whenever data is received during download.
Declaration
Swift
public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data)
-
Called when detailed metrics are available for a completed task.
Declaration
Swift
public func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics)