A Swift package for measuring and reporting execution time of operations with support for nested measurements and statistical analysis.
Duration is a Swift package for measuring and reporting the execution time of code operations. It helps developers identify performance bottlenecks by providing simple APIs for timing blocks of code, supporting nested measurements, and calculating statistical metrics like averages and standard deviations. The package is cross-platform and designed for practical use in Swift projects.
Swift developers working on iOS, macOS, tvOS, or Linux projects who need to profile code performance, debug bottlenecks, or conduct basic benchmarking.
Developers choose Duration for its simplicity, lightweight design, and practical features like nested measurements and statistical analysis, making it an easy-to-integrate tool for performance testing without heavy dependencies.
A simple Swift package for measuring and reporting the time taken for operations
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers both start/stop calls and block-based syntax, making it easy to insert timing into existing Swift code without complex setup.
Supports nested measurements with indented output, allowing developers to analyze performance across function call hierarchies for debugging bottlenecks.
Can run multiple iterations to compute average execution times and standard deviations, revealing performance consistency and deviations in algorithms.
Allows disabling logging via logStyle settings or push/pop methods, useful for release builds or library distribution to avoid unwanted output.
Lacks support for logging measurements to data structures for external analysis, as acknowledged in the README, restricting post-processing or integration with other tools.
Only provides .None and .Print log styles, with no built-in file output or compatibility with standard logging frameworks, limiting flexibility in production environments.
Requires explicit code insertion for every measurement, unlike automated profilers that can instrument code without modifications, increasing development overhead.