tuffy.util
Class Timer

java.lang.Object
  extended by tuffy.util.Timer

public class Timer
extends java.lang.Object

Container of time related utilities.


Nested Class Summary
static class Timer.RunStat
           
 
Field Summary
static Timer.RunStat runStat
           
 
Constructor Summary
Timer()
           
 
Method Summary
static java.lang.String elapsed()
          Returns a string of elapsed time.
static java.lang.String elapsed(java.lang.String name)
          Returns the elapsed time of the timer with the given name.
static double elapsedMilliSeconds(java.lang.String name)
           
static double elapsedSeconds()
          Returns the number of elapsed seconds since last clock reset.
static double elapsedSeconds(java.lang.String name)
          Returns the number of elapsed seconds of a given timer; -1 if the timer is unknown.
static java.lang.String getDateTime()
           
static void printElapsed()
          Prints the elapsed time since last clock reset.
static void printElapsed(java.lang.String name)
          Prints the elapsed time of the timer with the given name.
static void resetClock()
          Resets the global starting point of the Timer.
static void start(java.lang.String name)
          Kicks off a timer with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runStat

public static Timer.RunStat runStat
Constructor Detail

Timer

public Timer()
Method Detail

elapsed

public static java.lang.String elapsed()
Returns a string of elapsed time.


elapsed

public static java.lang.String elapsed(java.lang.String name)
Returns the elapsed time of the timer with the given name. The format is [XX minutes, YYseconds].


elapsedMilliSeconds

public static double elapsedMilliSeconds(java.lang.String name)

elapsedSeconds

public static double elapsedSeconds()
Returns the number of elapsed seconds since last clock reset.


elapsedSeconds

public static double elapsedSeconds(java.lang.String name)
Returns the number of elapsed seconds of a given timer; -1 if the timer is unknown.

Parameters:
name - the name of the timer

getDateTime

public static java.lang.String getDateTime()

printElapsed

public static void printElapsed()
Prints the elapsed time since last clock reset. The format is TIMER: [XX minutes, YYseconds].


printElapsed

public static void printElapsed(java.lang.String name)
Prints the elapsed time of the timer with the given name. The format is TIMER name: [XX minutes, YYseconds].


resetClock

public static void resetClock()
Resets the global starting point of the Timer.


start

public static void start(java.lang.String name)
Kicks off a timer with the given name.