Skip to content

tmspzz/stopwatch

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published