java.lang.Object
org.freedesktop.dbus.utils.TimeMeasure
Utility class for time measurements.
Instances may be reset for reuse.
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreate a new instance, used a formatter converting everything >= 5000 ms to seconds (X.Y -> 6.1).TimeMeasure(TimeMeasure.ITimeMeasureFormat _formatter) Create a new instance using _ts millis as -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglongReturns the elapsed time in milliseconds.longgetElapsedFormatted(DateFormat _dateFormat) Formats the elapsed time using the given dateFormatter.longReturns the elapsed time in seconds.longReturns the start time in milliseconds.final TimeMeasurereset()Resets the start time.toString()Returns the elapsed time in milliseconds formatted as string.
-
Konstruktordetails
-
TimeMeasure
Create a new instance using _ts millis as- Parameter:
_formatter- formatter to use for toString() call
-
TimeMeasure
public TimeMeasure()Create a new instance, used a formatter converting everything >= 5000 ms to seconds (X.Y -> 6.1).
-
-
Methodendetails
-
reset
Resets the start time.- Gibt zurück:
- the object
-
getStartTime
public long getStartTime()Returns the start time in milliseconds.- Gibt zurück:
- start time in ms
-
getElapsed
public long getElapsed()Returns the elapsed time in milliseconds.- Gibt zurück:
- elapsed time in ms
-
getElapsedSeconds
public long getElapsedSeconds()Returns the elapsed time in seconds.- Gibt zurück:
- elapsed time in seconds
-
getElapsedFormatted
Formats the elapsed time using the given dateFormatter. If null is given, a new Formatter with format HH:mm:ss.SSS will be used. The timezone of the given dateFormatter will always be set to 'UTC' to avoid any timezone related offsets.- Parameter:
_dateFormat- date format- Gibt zurück:
- formatted string
-
getElapsedAndReset
public long getElapsedAndReset() -
toString
Returns the elapsed time in milliseconds formatted as string.
-