Class ElapsedTimer


  • public class ElapsedTimer
    extends Object

    ElapsedTimer: Utility class for keep track of the duration an object has been in existence.

    • Constructor Summary

      Constructors 
      Constructor Description
      ElapsedTimer()
      Construct a new ElapsedTimer and start the clock
      ElapsedTimer​(long timestamp)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Date getDate()
      Get the date the object was created
      String getDateString()
      Get the date object was created as formatted String
      long getTime()
      Get elapsed time object in existence (milliseconds)
      double getTimeSeconds()
      Get elapsed time object in seconds
      String getTimeString()
      Get elapsed time object in existence as formatted String (Ex: 3 days 2 minutes 5 seconds)
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElapsedTimer

        public ElapsedTimer()
        Construct a new ElapsedTimer and start the clock
      • ElapsedTimer

        public ElapsedTimer​(long timestamp)
    • Method Detail

      • getDate

        public java.util.Date getDate()
        Get the date the object was created
        Returns:
        date object created
      • getDateString

        public String getDateString()
        Get the date object was created as formatted String
        Returns:
        date object created as formatted String
      • getTime

        public long getTime()
        Get elapsed time object in existence (milliseconds)
        Returns:
        elapsed time (milliseconds)
      • getTimeSeconds

        public double getTimeSeconds()
        Get elapsed time object in seconds
        Returns:
        elapsed time in seconds
      • getTimeString

        public String getTimeString()
        Get elapsed time object in existence as formatted String (Ex: 3 days 2 minutes 5 seconds)
        Returns:
        elapsed time as formatted String