I have real issues with the misconceptions about what Ping tells you. Everyone seems to forget that there is a temporal component involved. Yes, I have an example of how you might always track latency. In this example I use a webbrowser.

Code:
    Dim latency As New Stopwatch
    Dim loaded As Boolean = False

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        latency.Stop() 'stop 
        'latency.Elapsed has time
        Debug.WriteLine(latency.Elapsed.TotalSeconds.ToString("N1"))
        loaded = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not loaded Then
            loaded = True
            latency.Reset() 'set to 0 and stop
            latency.Start()
            Try
                WebBrowser1.Navigate("www.yahoo.com")
            Catch ex As Exception
                Stop
                loaded = False
            End Try
        End If
    End Sub
I have no idea what this "...maybe you can give me the substraction code..." means.