[PD] A non-leaky stopwatch

Phil Stone pkstone at ucdavis.edu
Tue Feb 24 02:45:49 CET 2009


Hello,

Attached is a stopwatch, derived from [maketime], that doesn't pollute 
the symbol table (i.e., indefinitely leak memory), thanks to Frank B.'s 
idea for keeping the symbols re-usable.

It has one-second grain, so it does not keep track of partial seconds 
between stops and restarts-with-no-reset.  However, it is quite accurate 
after resets and when first started.  I learned that metro sends an 
immediate bang when started -- something I had never paid attention to 
before.  So [ps-stopwatch] always skips the first bang out of [metro] 
(after reset) so that it isn't one second ahead.  It counts up to 99 
hours, 59 minutes, and 59 seconds, then wraps back to zero.

It would be easy to make this a finer-grain stopwatch, down to the 
inherent resolution of [metro].  However, for my purposes (timing of 
live performance) one-second grain is quite adequate, and not too 
CPU-hungry.

Thanks again to Frank for this elegant solution.


Phil Stone
www.pkstonemusic.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ps-stopwatch.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090223/d4284f06/attachment.asc>


More information about the Pd-list mailing list