title: How can i get the time in ping?
body: <p>I use this code to ping the website google.com</p>
  
  <pre><code>    public String ping(String url) {
         String str = "";
         try {
             Process process = Runtime.getRuntime().exec(
                     "/system/bin/ping -c 1 " + url);
             BufferedReader reader = new BufferedReader(new InputStreamReader(
                     process.getInputStream()));
  
             int i;
             char[] buffer = new char[4096];
             StringBuffer output = new StringBuffer();
  
             while ((i = reader.read(buffer)) &gt; 0)
                 output.append(buffer, 0, i);
             reader.close();
  
             // body.append(output.toString()+"\n");
             str = output.toString();
             Log.d("str", str);
         }
         catch (IOException e) {
             // body.append("Error\n");
             e.printStackTrace();
         }
         return str;
     }
  </code></pre>
  
  <p>The log-cat output looks like that:</p>
  
  <pre><code>11-12 07:23:34.028: D/str(1399): PING www.google.com (216.58.209.196) 56(84) bytes of data. 
  11-12 07:23:34.028: D/str(1399): 64 bytes from bud02s22-in-f4.1e100.net (216.58.209.196): icmp_seq=1 ttl=48
  **time=149 ms** 
  11-12 07:23:34.028: D/str(1399): --- www.google.com ping statistics --- 
  11-12 07:23:34.028: D/str(1399): 1 packets transmitted, 1 received, 0% packet loss, time 0ms 
  11-12 07:23:34.028: D/str(1399): rtt min/avg/max/mdev = 149.750/149.750/149.750/0.000 ms
  </code></pre>
  
  <p>Have anyone and idea how I can just get the "time=149 ms" value?
  Thanks in advance!</p>