oracle.bali.share.util
Class Timing
java.lang.Object
|
+--oracle.bali.share.util.Timing
- public class Timing
- extends java.lang.Object
Simple class for doing performance timing in Java applications
Method Summary |
static void |
displayElapsedString(java.applet.Applet applet,
long lastTime)
Displays a string containing the number of seconds that have elapsed since
lastTime. |
static long |
getElapsedMillis(long lastTime)
Returns the number of milliseconds that have elapsed since
lastTime. |
static double |
getElapsedSeconds(long lastTime)
Returns the number of seconds that have elapsed since
lastTime. |
static java.lang.String |
getElapsedString(long lastTime)
Returns a string containing the number of seconds that have elapsed since
lastTime. |
static long |
getStartTimeMillis()
Returns the current system time so that we can determine the elapsed
time later. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Timing
public Timing()
getStartTimeMillis
public static long getStartTimeMillis()
- Returns the current system time so that we can determine the elapsed
time later. The system time is returned after performing a garbage
collection to make multiple timings more consistent.
- See Also:
getElapsedMillis(long)
,
getElapsedSeconds(long)
,
getElapsedString(long)
,
displayElapsedString(java.applet.Applet, long)
getElapsedMillis
public static long getElapsedMillis(long lastTime)
- Returns the number of milliseconds that have elapsed since
lastTime.
- Parameters:
lastTime
- The time in milliseconds to compute the elapsed time from- See Also:
getElapsedSeconds(long)
,
getElapsedString(long)
,
displayElapsedString(java.applet.Applet, long)
getElapsedSeconds
public static double getElapsedSeconds(long lastTime)
- Returns the number of seconds that have elapsed since
lastTime.
- Parameters:
lastTime
- The time in milliseconds to compute the elapsed time from- See Also:
getElapsedMillis(long)
,
getElapsedString(long)
,
displayElapsedString(java.applet.Applet, long)
getElapsedString
public static java.lang.String getElapsedString(long lastTime)
- Returns a string containing the number of seconds that have elapsed since
lastTime.
- Parameters:
lastTime
- The time in milliseconds to compute the elapsed time from- See Also:
getElapsedMillis(long)
,
getElapsedSeconds(long)
,
displayElapsedString(java.applet.Applet, long)
displayElapsedString
public static void displayElapsedString(java.applet.Applet applet,
long lastTime)
- Displays a string containing the number of seconds that have elapsed since
lastTime.
- Parameters:
applet
- The applet to display the string in. If an applet is passed
in, the string will be displayed in the Applet's status line, otherwise,
the string will be written to System.out.lastTime
- The time in milliseconds to compute the elapsed time from- See Also:
getElapsedMillis(long)
,
getElapsedSeconds(long)
,
displayElapsedString(java.applet.Applet, long)