Stopwatch v0.0.2 Stopwatch.Timer
This module provides a friendly API for working with timers
It allows you to start, lap, stop and clear timers referencing them by name.
Summary
Functions
clear all the active timers
Count the active timers
a stopwatch has two buttons, one to start and stop it, and another to measure the lap time. This is what the lap method is for
peek at the timer while it continues to measure. Useful for logging purposes
Start a new timer by giving it a an arbitrary name and an optional start time The name can be anything that is unique to your application. A good idea could be an atom or a binary string
Stop the given timer, and returns it
Functions
Specs
count :: integer
Count the active timers
Examples
iex> use Stopwatch
...> Timer.count
0
iex> Timer.start("test")
...> Timer.count
1
iex> Timer.stop("test")
...> Timer.count
0
Specs
lap(Stopwatch.Watch, binary) :: Stopwatch.Watch
a stopwatch has two buttons, one to start and stop it, and another to measure the lap time. This is what the lap method is for.
You can optionally give the a name to the lap for later use
Specs
peek(Stopwatch.Watch) :: {integer, integer, integer}
peek at the timer while it continues to measure. Useful for logging purposes.
It returns a tuple with format {megasecs, secs, microsecs}
Specs
start(any, Timex.Time) :: any
Start a new timer by giving it a an arbitrary name and an optional start time The name can be anything that is unique to your application. A good idea could be an atom or a binary string.
Be careful, no error is raised if you start two timers with the same name, the last one will simply replace the first.