public final class Ping extends Object
Modifier and Type | Method and Description |
---|---|
long |
roundTripTime()
Returns the round trip time for this ping in nanoseconds, waiting for the
response to arrive if necessary.
|
long |
roundTripTime(long timeout,
TimeUnit unit)
Returns the round trip time for this ping in nanoseconds, or -1 if the
response was canceled, or -2 if the timeout elapsed before the round
trip completed.
|
public long roundTripTime() throws InterruptedException
InterruptedException
public long roundTripTime(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
Copyright © 2015. All rights reserved.