LCL Speedtest

LCL Speedtest 是一个用 Swift 编写的跨平台 Speedtest 客户端库。该库是 M-Lab 的 NDT7 协议的社区实现。

使用测量资源时,请遵守 M-Lab 的政策和规则。

要求

开始使用

将以下内容添加到您的 Package.swift 文件中

.package(url: "https://github.com/Local-Connectivity-Lab/lcl-speedtest.git", from: "1.0.0")

然后将模块导入到您的项目中

.target(
    name: "YourAppName",
    .dependencies: [
        .product(name: "LCLSpeedtest", package: "lcl-speedtest")
    ]
)

基本用法

var testClient = SpeedTestClient()
testClient.onDownloadProgress = { measurement in
    print(measurement)
}
testClient.onUploadProgress = { measurement in
    print(measurement)
}
try await testClient.start(with: .downloadAndUpload)

特性

贡献

欢迎任何贡献和 pull request!但是,在您计划实施某些功能或尝试修复不确定的问题之前,建议先发起讨论。您也可以加入我们的 Discord 频道,或访问我们的 网站

许可证

LCL Speedtest 在 Apache License 下发布。有关更多详细信息,请参阅 LICENSE