code: public static long timedPing( final String    server )
          throws
              UnknownHostException,
              IOException
      {
          StopWatch    stopwatch = new StopWatch();
          stopwatch.start();
  
          boolean    reachable;
          reachable = ping( server );
  
          stopwatch.stop();
  
          if ( reachable )
          {
              return stopwatch.getTime();
          }
  
          return -1;
      }
docs: Tries to make a connection to the host's port 7 (Echo)
  @param server to ping
  @return time in milliseconds for response.  -1 if no response.
  @throws java.io.IOException if problems
  @throws java.net.UnknownHostException if unknown host