Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Googler


Сообщения: 3665
Благодарности: 1563

Профиль | Отправить PM | Цитировать


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

Последний раз редактировалось amel27, 13-06-2007 в 03:11.

Это сообщение посчитали полезным следующие участники:

Отправлено: 09:38, 12-06-2007 | #12