A normal Stopwatch has only start() and stop() abilities and getTime() returns the difference between these two times.

A burst Stopwatch uses the start and stop as well, but does not reset the time with every call, but keeps a cumulative time difference. Such as stop1-start1 + stop2-start2 + ... = final. This is useful for measuring a part of the loop without calculating the overall time of the loop, as in normal and lap, thus allowing you to diagnose which portion of the loop is causing the slowdown.

A lap Stopwatch uses start() and lap() to mark intervals in the overall time. This is useful for getting statistics on minimum, maximum, and average loop times so you can determine best-case, worst-case, and average-runs on sections of code.

Uses Time::HiRes to calculate the most accurate results within fast loops

Stops the Stopwatch, or (code-wise) saves the current time in a local 'stop' reference, and does the following based on type of Stopwatch. If normal, saves the difference of the start and stop. If burst, calculates the difference and adds it to the running total. If lap, saves the difference as the current lap and increments lap counter.

This was created to be inserted quickly into any script as a reference (SEE CAVEATS), since it requires very little modification of the original code that is being debugged, and is just as easy to remove when code is put into production. It is not designed for benchmarking or serious calculations since the module code itself is not optimized. As mentioned in CAVEATS, a simple for-loop takes about 5 microseconds to just start and stop a lap Stopwatch on my test systems.

Uses Time::HiRes and is thus succeptible to all CAVEATS listed therein. Another known issue unreliable results in a multi-thread environment that also propagates from Time::HiRes.

This is just a simple reference of time elapsed throughout a script and should be used for debugging and optimiziation purposes only. In only a simple loop, Perf::Stopwatch has a minimum number of microseconds that it takes to copy the retrieve and copy time-values and increment lap-indices. In my test cases, this has been approximately 5 microseconds in a simple for-loop. This only becomes a factor when comparing already optimized loops. If your loops have execution times in the 100ths of a second or more, then the time use by Perf::Stopwatch is neglible.