1.第一种方法
let start = CFAbsoluteTimeGetCurrent()
let data = try! Data(contentsOf: url)
let end = CFAbsoluteTimeGetCurrent()
print(end - start)
let start = Date() let data = try! Data(contentsOf: url) let end = Date() print(end.timeIntervalSince(start))
网友评论