public class MillisTimer extends Object implements MediaTimer
MediaTimer interface using System.currentTimeMillis() to obtain
timing information.
Note: System.currentTimeMillis() is notoriously inaccurate on different
platforms. See
bug report 4486109 for more information.
Also note: clock drift on Windows XP is especially pronounced and is exacerbated by the fact that WinXP periodically resyncs the system clock with the hardware clock, causing discontinuous jumps in the progression of time (usually backwards in time).
| Constructor and Description |
|---|
MillisTimer() |
| Modifier and Type | Method and Description |
|---|---|
long |
getElapsedMicros()
Returns the number of microseconds that have elapsed since the
timer was created or last
MediaTimer.reset(). |
long |
getElapsedMillis()
Returns the number of milliseconds that have elapsed since the
timer was created or last
MediaTimer.reset(). |
void |
reset()
Resets the timer's monotonically increasing value.
|
public void reset()
MediaTimerreset in interface MediaTimerpublic long getElapsedMillis()
MediaTimerMediaTimer.reset(). Note: the
accuracy of this method is highly dependent on the timer
implementation used.getElapsedMillis in interface MediaTimerpublic long getElapsedMicros()
MediaTimerMediaTimer.reset(). Note: the
accuracy of this method is highly dependent on the timer
implementation used.getElapsedMicros in interface MediaTimerCopyright © 2015. All rights reserved.