Measure

master

⏲ A tiny package to measure code execution time. Only 20 lines of code.
mezhevikin/Measure

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

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Apr 11 2024 19:59:26 GMT-0900 (Hawaii-Aleutian Daylight Time)