Skip to content

Commit a0ea38e

Browse files
author
Alex Huang
committed
Added a method to tell if the inaccurate clock is keeping up with the current time
1 parent 5fc13a6 commit a0ea38e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

utils/src/com/cloud/utils/time/InaccurateClock.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ public InaccurateClock() {
4848
}
4949
}
5050

51+
@Override public long[] getCurrentTimes() {
52+
long[] results = new long[2];
53+
results[0] = time;
54+
results[1] = System.currentTimeMillis();
55+
56+
return results;
57+
}
58+
5159
@Override
5260
public synchronized String restart() {
5361
turnOff();

utils/src/com/cloud/utils/time/InaccurateClockMBean.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ public interface InaccurateClockMBean {
77
String restart();
88

99
String turnOff();
10+
11+
long[] getCurrentTimes();
1012
}

0 commit comments

Comments
 (0)