Added a method to tell if the inaccurate clock is keeping up with the current time

This commit is contained in:
Alex Huang 2011-08-09 10:53:12 -07:00
parent 5fc13a63b1
commit a0ea38eb24
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,14 @@ public class InaccurateClock extends StandardMBean implements InaccurateClockMBe
}
}
@Override public long[] getCurrentTimes() {
long[] results = new long[2];
results[0] = time;
results[1] = System.currentTimeMillis();
return results;
}
@Override
public synchronized String restart() {
turnOff();

View File

@ -7,4 +7,6 @@ public interface InaccurateClockMBean {
String restart();
String turnOff();
long[] getCurrentTimes();
}