Skip to content

vexy/Stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stopwatch

Zero dependency Swift stopwatch. Figurable in seconds !

Usage

Overall Stopwatch usage is fairly straightforward.
You mark beginning of the measurement interval and probe elapsed time at desired moment.

Simple use case coud be:

function doSomething() {
    // Mark beginning of measuring interval
    Stopwatch.begin()
    
    somethingThatTakesTime()
    
    // Show elapsed time string
    print("Elapsed: \(Stopwatch.elapsed)")
}

Installation

Stopwatch can be easily installed using SPM.

Package name: Stopwatch
Package URL: https://github.com/vexy/Stopwatch

And that's it. Enjoy!


Copyright (c) Vex 2023
PGP: 6302 D860 B74C BD34 6482 DBA2 5187 66D0 8213 DBC0

profile for Vexy on Stack Exchange, a network of free, community-driven Q&A sites