Class Clock
java.lang.Object
org.variantsync.diffdetective.util.Clock
A clock counting the number of milliseconds since it was
start
ed.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the number of milliseconds sincestart()
.double
Returns the number of seconds sincestart()
.Returns a human readable string containing the number seconds sincestart()
with a unit.static String
printPassedSeconds
(double seconds) Returns a human readable string containingseconds
with a unit.void
start()
The clock now.static double
toSeconds
(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 aClock
andstart()
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 containingseconds
with a unit. -
toString
-