Package com.spun.util.timers
Class Counter
java.lang.Object
com.spun.util.timers.Counter
public class Counter extends Object
A Utility for counting things.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description intgetAverageClicksPerTime(long timeInMilli)intgetCount()StringgetLabel()longgetLastTime()DateDifferencegetLastTimeDifference()longgetTimeSinceLast()longgetTimeSinceStart()voidinc()voidreset()static Counter[]toArray(Vector vectorOf)A convenience function to turn a vector of Counter objects into an Array of the Counter objects.StringtoString()
-
Constructor Details
-
Counter
public Counter() -
Counter
-
-
Method Details
-
inc
public void inc() -
reset
public void reset() -
getCount
public int getCount() -
getLastTime
public long getLastTime() -
getAverageClicksPerTime
public int getAverageClicksPerTime(long timeInMilli) -
getTimeSinceLast
public long getTimeSinceLast() -
getTimeSinceStart
public long getTimeSinceStart() -
getLastTimeDifference
-
toString
-
toArray
A convenience function to turn a vector of Counter objects into an Array of the Counter objects.- Parameters:
vectorOf- a Vector of Counter objects- Returns:
- the array of Counter.
- Throws:
Error- if an element of vectorOf is not a Counter object.
-
getLabel
-