How is speed always calculated? Distance divided by time. You need to determine the number of bytes received since the last event and the time since the last event, then divide them.
vb.net Code:
Private byteCount As Long
Private timer As Stopwatch
Private Sub wc_DownloadProgressChanged(ByVal sender As Object, _
ByVal e As Net.DownloadProgressChangedEventArgs) Handles wc.DownloadProgressChanged
Me.ProgressBar1.Maximum = CInt(e.TotalBytesToReceive)
Me.ProgressBar1.Value = CInt(e.BytesReceived)
Dim bits As Long = (e.BytesReceived - Me.byteCount) * 8
Dim seconds As Double = Me.timer.Elapsed.TotalSeconds
Dim speed As Integer = CInt(bits / seconds)
Me.StatusLBL.Text = e.ProgressPercentage & "% Complete (" & speed & " bps)"
Me.byteCount = e.BytesReceived
Me.timer = Stopwatch.StartNew()
End Sub
That's the most accurate current speed calculation possible under the circumstances. If you want average speed then you'd calculate the total number of bytes received and the total time taken.