Class Clock
java.lang.Object
org.variantsync.diffdetective.util.Clock
A clock counting the number of milliseconds since it was
started.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of milliseconds sincestart().doubleReturns the number of seconds sincestart().Returns a human readable string containing the number seconds sincestart()with a unit.static StringprintPassedSeconds(double seconds) Returns a human readable string containingsecondswith a unit.voidstart()The clock now.static doubletoSeconds(long milliseconds) Convert the number of milliseconds to a number of seconds.toString()
-
Field Details
-
startTime
private long startTime
-
-
Constructor Details
-
Clock
public Clock()Constructs aClockandstart()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 sincestart(). -
getPassedSeconds
public double getPassedSeconds()Returns the number of seconds sincestart(). -
printPassedSeconds
Returns a human readable string containing the number seconds sincestart()with a unit. -
toSeconds
public static double toSeconds(long milliseconds) Convert the number of milliseconds to a number of seconds. -
printPassedSeconds
Returns a human readable string containingsecondswith a unit. -
toString
-