LIMITER Posted February 8, 2008 Share Posted February 8, 2008 I have a script which downloads something from a website ... How can i measure the current download speed ? (like ie does) Link to comment Share on other sites More sharing options...
covaks Posted February 8, 2008 Share Posted February 8, 2008 (edited) I posted this earlier tonight. $objWMIService = ObjGet("winmgmts:\\.\root\cimv2") $objClass = $objWMIService.ExecQuery("Select * from Win32_PerfRawData_Tcpip_NetworkInterface") For $obj in $objClass msgbox(1,"","Interface: " & $obj.Name & @CRLF & _ "Bytes Received/sec: " & $obj.BytesReceivedPerSec & @CRLF & _ "Bytes Sent/sec: " & $obj.BytesSentPerSec & @CRLF & _ "Bytes Total/sec: " & $obj.BytesTotalPerSec & @CRLF & _ "Network rate: " & $obj.CurrentBandwidth) Next It just reports back in Bytes/sec, so just divide by 1024 to convert to KB/s. eg: "Round(obj.BytesReceivedPerSec /1024,2)" or something. Edited February 8, 2008 by covaks Link to comment Share on other sites More sharing options...
LIMITER Posted February 8, 2008 Author Share Posted February 8, 2008 i used the script but this is showing ALL bytes received ... i want to show like uTorrent or Internet Explorer Something like this : 203892 of 23890839840 kb downloaded Download speed : 65.5 kb/s Link to comment Share on other sites More sharing options...
covaks Posted February 8, 2008 Share Posted February 8, 2008 (edited) I see. I'm not sure how to get that for external programs.. If you initiate the download with InetGet in your own script though, this should work: $TotalSize = InetGetSize ( "ftp://ftp.microsoft.com/Products/frontpage/fp40.rs6000.tar.Z") INetGet("ftp://ftp.microsoft.com/Products/frontpage/fp40.rs6000.tar.Z","File",1,1) $hWnd = GUICreate("") $Label = GUICtrlCreateLabel("",5,5,200,40) GUISetState() $Time = @SEC While 1 $msg = GUIGetMsg() $Time = @SEC $Bytes = Round(@InetGetBytesRead) While @SEC = $Time WEnd $NewBytes = Round(@InetGetBytesRead) GUICtrlSetData($Label,($NewBytes - $Bytes) /1024 & "KB/s") WEnd Edited February 8, 2008 by covaks JoeBar 1 Link to comment Share on other sites More sharing options...
LIMITER Posted February 8, 2008 Author Share Posted February 8, 2008 THX Link to comment Share on other sites More sharing options...
weaponx Posted February 8, 2008 Share Posted February 8, 2008 Sort of unrelated but the only program i've ever found that shows you upload / download speed for every process is called NetPeeker.http://www.net-peeker.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now