WoW:API GetNetStats: Difference between revisions

Clarifying print message example
(more precise)
(Clarifying print message example)
Line 3: Line 3:
Retrieve info about net statistics.
Retrieve info about net statistics.


down, up, lag = GetNetStats();
down, up, lagHome, lagWorld = GetNetStats();


----
----
Line 12: Line 12:
:;up : Current outgoing bandwidth (upload) usage, measured in KB/s.
:;up : Current outgoing bandwidth (upload) usage, measured in KB/s.


:;lag : Floating Point Number - Average roundtrip latency to the server (only updated every 30 seconds).
:;lagHome : Floating Point Number - Average roundtrip latency of your connection to the server (only updated every 30 seconds).
 
:;lagWorld : Floating Point Number - Average dynamic latency of the area you are in within the world
----
----
;''Example''
;''Example''
  local down, up, lag = GetNetStats();<br>
  local down, up, lagHome, lagWorld = GetNetStats();<br>
  message("Lag: "..lag.." milliseconds.");  
  message("Connection Lag: "..lagHome.." milliseconds, World Lag: "..lagWorld );  


;''Result''
;''Result''
Line 26: Line 28:


: Retrieve information about your current net statistics.
: Retrieve information about your current net statistics.
: Note that WoW 4.0.6 has added a return value so that two distinct latency values are now returned...
Anonymous user