Class LapTimer

java.lang.Object
com.spun.util.timers.LapTimer

public class LapTimer extends Object
A Utility for timing things. this is NOT multi-thread safe.
  • Constructor Details

    • LapTimer

      public LapTimer()
    • LapTimer

      public LapTimer(String label)
  • Method Details

    • registerClock

      public static void registerClock(Clock clock)
    • getLabel

      public String getLabel()
    • lap

      public long lap(String label)
      Marks the time for a lap and a label. ie. A timer could store - 1 hour 10 mins ["1st Quarter", 15 mins,"2nd Quarter", 15 mins,"Half Time", 10 mins, "3rd Quarter", 15 mins,"4th Quarter", 15 mins]
    • end

      public long end(String label)
    • isPaused

      public boolean isPaused()
    • pause

      public void pause()
    • resume

      public void resume()
    • lap

      public long lap(boolean end, String label)
    • getLapTimes

      public LapTime[] getLapTimes()
    • getLapCount

      public int getLapCount()
    • getLap

      public LapTime getLap(int i)
    • getLap

      public LapTime getLap(String label)
    • getTotalTime

      public long getTotalTime()
    • getTotalTimeAsDateDifference

      public DateDifference getTotalTimeAsDateDifference()
    • toString

      public String toString()
      Overrides:
      toString in class Object