Class Clock

java.lang.Object
org.variantsync.diffdetective.util.Clock

public class Clock extends Object
A clock counting the number of milliseconds since it was started.
  • Field Details

    • startTime

      private long startTime
  • Constructor Details

    • Clock

      public Clock()
      Constructs a Clock and start()s it for convenience.
  • Method Details

    • start

      public void start()
      The clock now. Previous start times are not remembered.
    • getPassedMilliseconds

      public long getPassedMilliseconds()
      Returns the number of milliseconds since start().
    • getPassedSeconds

      public double getPassedSeconds()
      Returns the number of seconds since start().
    • printPassedSeconds

      public String printPassedSeconds()
      Returns a human readable string containing the number seconds since start() with a unit.
    • toSeconds

      public static double toSeconds(long milliseconds)
      Convert the number of milliseconds to a number of seconds.
    • printPassedSeconds

      public static String printPassedSeconds(double seconds)
      Returns a human readable string containing seconds with a unit.
    • toString

      public String toString()
      Overrides:
      toString in class Object