Clock: Make forward slewing work better

when now() is not called too frequently
This commit is contained in:
zzz
2015-04-29 11:48:17 +00:00
parent 2a2587b13d
commit 0f18686243

View File

@@ -250,7 +250,8 @@ public class RouterClock extends Clock {
long desiredOffset = _desiredOffset;
if (desiredOffset > offset) {
// slew forward
_offset = ++offset;
offset += Math.min(10, sinceLastSlewed / MAX_SLEW);
_offset = offset;
} else if (desiredOffset < offset) {
// slew backward, but don't let the clock go backward
// this should be the first call since systemNow