public static StopWatch makeSynchronized ( final StopWatch watch ) { return new Wrapper ( watch ) { /** The serialVersionUID */ private static final long serialVersionUID = - 6284244000894114817L ; public synchronized void start ( final boolean reset ) { this . watch . start ( reset ) ; } public synchronized void start ( ) { this . watch . start ( ) ; } public synchronized long stop ( ) { return this . watch . stop ( ) ; } public synchronized void reset ( ) { this . watch . reset ( ) ; } public synchronized long getLapTime ( ) { return this . watch . getLapTime ( ) ; } public synchronized long getAverageLapTime ( ) { return this . watch . getAverageLapTime ( ) ; } public synchronized int getLapCount ( ) { return this . watch . getLapCount ( ) ; } public synchronized long getTime ( ) { return this . watch . getTime ( ) ; } public synchronized boolean isRunning ( ) { return this . watch . isRunning ( ) ; } public synchronized String toString ( ) { return this . watch . toString ( ) ; } } ; }
Return a synchronized stop watch .