Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

stopwatch

Carthage compatible

A quick time profiling utility framework.

What is stopwatch

Sometimes you just want to have an idea of how long some code takes to execute, without firing up Instruments and using the time profiler.

Stopwatch does just that. Read more about the motivations behinde it at http://allocinit.io/ios/timing-function-execution-stopwatch/.

Usage

  • Create a StopWatch
  • Start an event
  • call function
  • Stop event
  • Log execution time (in milliseconds)

Example:

let stopWatch = StopWatch(name:"SleepingBeauty")

stopWatch.startEvent("Sleeping")
                        
for i in 0...10000 {
    usleep(10)
}

let event = stopWatch.stopEvent("Sleeping")
println(event?.elapsedTime)

About

A quick time profiling utility framework

Resources

License

Releases

No releases published
You can’t perform that action at this time.