com.grandcentral.appstats
Interface Timer

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable, Stat
All Known Implementing Classes:
SynchronizedTimerImpl, TimerImpl

public interface Timer
extends Stat

Base Timer Implementation

Copyright: Copyright (c) 2002

Company: Grand Central Communications

Version:
1.0
Author:
Taras Shkvarchuk, Adrian Dorsman

Fields inherited from interface com.grandcentral.appstats.Stat
AGGREGATE_AVG, AGGREGATE_EXPAVG, AGGREGATE_MAX, AGGREGATE_MIN, AGGREGATE_REPLACE, AGGREGATE_SUM, DELIM_STATNAME, DELIM_STATPREFIX, DELIM_TASKPARENT, DONT_AGGREGATE, TYPE_DOUBLE, TYPE_HEIRARCH, TYPE_HIDDEN, TYPE_LONG, TYPE_OBJECT, TYPE_UNDEFINED
 
Method Summary
 long getRunningTime()
          Returns total running time.
 void reset()
          clears timer value to 0
 long start()
          starts the timer and returns the start time
 long start(boolean reset)
          starts the timer and returns the start time.
 long stop()
          stops the timer and returns the timer's current value
 
Methods inherited from interface com.grandcentral.appstats.Stat
addAggregationMethod, addType, clone, containsAggregationMethod, containsType, fromStringAbbr, getAggregationMethod, getDouble, getFullName, getLong, getObject, getStatName, getStatPrefix, getStatSuffix, getTaskHierarchy, getType, prependTaskName, removeAggregationMethod, removeType, setAggregationMethod, setDouble, setFullName, setLong, setObject, setStatName, setStatPrefix, setStatSuffix, setTaskHierarchy, setType, toStringAbbr, toStringAbbr
 

Method Detail

start

public long start()
starts the timer and returns the start time
Returns:
-1 if timer already running

start

public long start(boolean reset)
starts the timer and returns the start time. Optionall resets before starting timer
Returns:
-1 if timer already running

stop

public long stop()
stops the timer and returns the timer's current value
Returns:
-1 if timer already stopped

reset

public void reset()
clears timer value to 0

getRunningTime

public long getRunningTime()
Returns total running time. Calculation is up to this moment if timer is still running. This does not stop the timer.