⏱️ A tiny package to measure code execution time.
let measure = Measure(key: "create-user")
let user = User()
measure.finish()
// ⏱️ Measure [create-user]: 0.00521 sec.
let measure = Measure(key: "request")
let url = URL(string: "https://httpbin.org/get")!
URLSession.shared.dataTask(with: url) { _, _, _ in
let time = measure.finish()
Analytics.send(event: "request", ["time" => time])
}.resume()
https://github.com/mezhevikin/Measure.git