use of hudson.util.ClockDifference in project hudson-2.x by hudson.
the class Slave method getClockDifference.
public ClockDifference getClockDifference() throws IOException, InterruptedException {
VirtualChannel channel = getChannel();
if (channel == null)
throw new IOException(getNodeName() + " is offline");
long startTime = System.currentTimeMillis();
long slaveTime = channel.call(new GetSystemTime());
long endTime = System.currentTimeMillis();
return new ClockDifference((startTime + endTime) / 2 - slaveTime);
}
Aggregations