|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.claudio.lib.Timer
public class Timer
Class for measuring time.
Note: Elapsed time is measured, including time waiting for I/O or because the CPU is allocated to another process.
Note: If used in recursive procedures with a depth>100 this class will cause ArrayBoundExctions.
Copyright (C) 2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster
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; version 2 of the License.
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 St, Fifth Floor, Boston, MA 02110-1301 USA
Constructor Summary | |
---|---|
Timer()
|
Method Summary | |
---|---|
static void |
dumpCollect()
Dump all collected data. |
long |
getCount()
|
long |
getDuration()
|
long |
getMax()
Return largest duration (time between a start and the following stop) for this timer. |
long |
getMean()
|
long |
getMin()
Return smallest duration (time between a start and the following stop) for this timer. |
static java.util.Collection<Timer> |
getTimers()
Return all timers in use. |
long |
getVariance()
|
static void |
main(java.lang.String[] args)
Print license. |
static void |
printSummary()
Print a summary of all timers to stdout |
static void |
printSummary(java.io.PrintWriter out)
Print a summary of all timers. |
static Timer |
start(java.lang.Object o)
Find timer identified by object or and start it. |
static void |
startCollect(int size)
Create an array and collect all start and stop events. |
void |
stop()
Stop timer. |
static void |
stopCollect()
Stop the collection of timer events. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Timer()
Method Detail |
---|
public static void startCollect(int size)
size
- of the arraypublic static void stopCollect()
public static void dumpCollect()
public static Timer start(java.lang.Object o)
o
- Typically a string used to distinguish this timer from a different
one.
public void stop()
public long getMax()
public long getMin()
public long getDuration()
public long getCount()
public long getMean()
public long getVariance()
public static java.util.Collection<Timer> getTimers()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public static void printSummary(java.io.PrintWriter out)
out
- destinationpublic static void printSummary()
public static void main(java.lang.String[] args)
args
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |