Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 592 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 592 Bytes

Measure

⏱️ A tiny package to measure code execution time.

let measure = Measure(key: "create-user")
let user = User()
measure.finish()

Console

// ⏱️ Measure [create-user]: 0.00521 sec.

Measure async request

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

Swift Package Manager

https://github.com/mezhevikin/Measure.git