--- In [email protected], "ninjariddick" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "swzoh" <seanzoh@> wrote:
> > As you said you needed only downloaded/uploaded bytes, you may try 
> the
> > following. I assumed you have only one enabled adapter.
> 
> Actually I ment current download/upload rate and not total. But 
> thanks for showing me the example. I will look for other API that 
> will hopefully provide such info.

You can calcurate the reates from them. For example, if you're running
the script periodically every 1 second, then:

----------------------------------------------------------------------
global dnrate,uprate
static _dn_,_up_

local tb=dll.create_array(215,"ui")
tb[129]=2

dll.call("iphlpapi|GetIfEntry|a*",tb)

dnrate = abs(eval("_dn_") - assign("_dn_", tb[139]))
uprate = abs(eval("_up_") - assign("_up_", tb[145]))

win.debug("Download rate: "++ (dnrate/1024.0).ftos("%0.1f")++" KB/s")
win.debug("Upload rate: "++ (uprate/1024.0).ftos("%0.1f")++" KB/s")
quit
----------------------------------------------------------------------

Sean

Reply via email to