NetworkSpeedTester

public class NetworkSpeedTester : NSObject, URLSessionDelegate, URLSessionDataDelegate, URLSessionTaskDelegate

Network speed testing utility that measures download performance across multiple URLs.

Constants

  • 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)

URLSessionDataDelegate

  • Called whenever data is received during download.

    Declaration

    Swift

    public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data)

URLSessionTaskDelegate

  • Called when detailed metrics are available for a completed task.

    Declaration

    Swift

    public func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics)