Improve polish notation, by suffixing Nanos, and removing 'In' keyword.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@926917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2010-03-24 03:19:30 +00:00
parent 3869beaa98
commit a637cd1a90
@@ -116,18 +116,18 @@ public final class ExecutionPool {
}
public static abstract class Pulse implements Delayed, Runnable {
protected final long expireTime;
protected final long expireTimeNanos;
protected Pulse(long delayInMillis) {
expireTime = System.nanoTime() + TimeUnit.NANOSECONDS.convert(delayInMillis, TimeUnit.MILLISECONDS);
protected Pulse(long delayMillis) {
expireTimeNanos = System.nanoTime() + TimeUnit.NANOSECONDS.convert(delayMillis, TimeUnit.MILLISECONDS);
}
public final long getDelay(TimeUnit unit) {
return unit.convert(expireTime - System.nanoTime(), TimeUnit.NANOSECONDS);
return unit.convert(expireTimeNanos - System.nanoTime(), TimeUnit.NANOSECONDS);
}
public final int compareTo(Delayed other) {
long r = (expireTime - ((Pulse) other).expireTime);
long r = (expireTimeNanos - ((Pulse) other).expireTimeNanos);
if (r < 0) return -1;
if (r > 0) return 1;
return 0;