Creat0R
Код:
If Not(InetGet("http://downloadmirror.intel.com/6667/eng/ISM556_Build7.exe", "xpSP2_ru.exe", 1, 1)) Then MsgBox (16,'','')
$begin = TimerInit()
While @InetGetActive
Sleep(250)
$AverageSpeed = (@InetGetBytesRead / TimerDiff($begin))
TrayTip("Downloading", "Average Speed = " & Int($AverageSpeed) & " Kbyte/sec", 10, 16)
Wend
Имхо текущую скорость удобней измерять через
AdLib():
Код:
Global $InetSpeed = 0, $InetGetBytesRead = 0, $InetTimeStamp = 0
AdlibEnable ("_InetGetSpeed", 1000)
InetGet("http://downloadmirror.intel.com/6667/eng/ISM556_Build7.exe", "test.exe", 1, 1)
While @InetGetActive
Sleep(250)
TrayTip("Downloading", "Speed = " & Int($InetSpeed) & " Kbyte/sec", 10, 16)
Wend
Func _InetGetSpeed()
If @InetGetActive Then
If @InetGetBytesRead <> -1 Then
Local $ticks = TimerDiff($InetTimeStamp)
If $ticks>0 Then $InetSpeed = (@InetGetBytesRead-$InetGetBytesRead) / $ticks
EndIf
$InetGetBytesRead = @InetGetBytesRead
$InetTimeStamp = TimerInit()
Else
$InetGetBytesRead = 0
$InetSpeed = 0
EndIf
EndFunc