³ò KŸDc@s)dZddkZddd„ƒYZdS(sStopwatch, a portable multi-lap timing utility class. Copyright (C) 2006 George F. Rice This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. iÿÿÿÿNt stopwatchcBsYeZdZdd„Zd„Zd„Zd„Zdd„Zdd„Zd d „Z RS( sÒ Implements a timer with multiple named lap timers. A newly created timer is NOT running. Use start() and stop() to begin/end. Check boolean '.running'. A lap timer is created on reference. RcCs7||_tiƒ|_d|_t|_h|_dS(Ng(tnamettimet startTimet elapsedTimetFalsetrunningtlap(tselfR((s#/home/cobra/Desktop/sw/Stopwatch.pyt__init__s    cCs*|iptiƒ|_t|_ndS(sª Start or restart the timer. Note that while the timer is running, only the getElapsedTime() method is accurate for determining elapsed time. N(RRRtTrue(R((s#/home/cobra/Desktop/sw/Stopwatch.pytstart$s cCs7|io)|itiƒ|i7_t|_ndS(s: Stop the timer and update the elapsedTime attribute. N(RRRRR(R((s#/home/cobra/Desktop/sw/Stopwatch.pytstop.s cCs1|io|itiƒ|iSn|iSdS(sc Returns the elapsed time as a float in seconds, regardless of the state of the timer. N(RRRR(R((s#/home/cobra/Desktop/sw/Stopwatch.pytgetElapsedTime5s s lap timercCs|iƒ|i|<|i|S(su Set (or reset) the named (or default) lap timer to the current elapsed time. The lap time is returned. (R R(RR((s#/home/cobra/Desktop/sw/Stopwatch.pyt stopLapTimer>scCs;y|i|SWn%|iƒ|i|<|i|SnXdS(sv Return the named (or default) lap time. If it doesn't exist, it is created as the current elapsed time. N(RR (RR((s#/home/cobra/Desktop/sw/Stopwatch.pyt getLapTimeEs cCs¬|djo|iƒ}n|i|ƒ}|d7}t|dƒ}||d8}t|dƒ}||d8}t|ƒ}||8}t|dƒ}d||||fS(s] Return specified lap time (or elapsed time if omitted) formatted as HH:MM:SS.ds g{®Gázt?ii<ids%.2d:%.2d:%.2d.%.2dN(tNoneR Rtint(RRt_ett_hht_mmt_sst_ds((s#/home/cobra/Desktop/sw/Stopwatch.pytgetFormattedTimeOs    N( t__name__t __module__t__doc__R R R R RRRR(((s#/home/cobra/Desktop/sw/Stopwatch.pyRs    ((RRR(((s#/home/cobra/Desktop/sw/Stopwatch.pyss