The following module was proposed for inclusion in the Module List: modid: Perf::Stopwatch DSLIP: bdpOp description: Multiple Timers for debugging code portions userid: KITDEKAT (Kit DeKat) chapterid: 3 (Development_Support) communities:
similar: Benchmark Benchmark::Timer Time::Stopwatch rationale: This was created to be inserted quickly into any script as a reference, since it requires very little modification of the original code that is being developed, 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 particularly optimized. As an example, a simple loop takes about 5 microseconds to just start and stop a batch-type Stopwatch on my test systems. There are three types of Stopwatches available; normal, lap, and burst. NORMAL has only start() and stop() abilities and getTime() returns the difference between these two times. LAP uses start() and lap() to mark intervals in the overall time. This is useful for getting statistics on getMinLap(), getMaxLap(), and average loop times so you can determine best-case, worst-case, and average-runs on sections of code. BURST 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. enteredby: KITDEKAT (Kit DeKat) enteredon: Fri Oct 31 01:05:23 2003 GMT The resulting entry would be: Perf:: ::Stopwatch bdpOp Multiple Timers for debugging code portions KITDEKAT Thanks for registering, -- The PAUSE PS: The following links are only valid for module list maintainers: Registration form with editing capabilities: https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=11500000_54cf46278db7a2dc&SUBMIT_pause99_add_mod_preview=1 Immediate (one click) registration: https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=11500000_54cf46278db7a2dc&SUBMIT_pause99_add_mod_insertit=1