Type: Integer
Returns the latency in milliseconds of the visitor's connection speed for downloads.
Note: To use this property you must set the SpeedCheckType property to indicate you wish to use the Progressive testing method, set the SupportFilesRoot property as required by the Progressive testing method, copy the speed test image files to your server as explained in the Progressive testing section, and call the GetExtPropertiesEx method before checking the value of this property.
Tip: See the speed.asp sample for a working example of the connection latency test.
Example:
<% set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "ConnectionSpeed, ConnectionLatency"
bhObj.SpeedCheckType = 1 ' turns on the Progressive testing method
bhObj.SupportFilesRoot = "url where you placed speed test image files"
bhObj.GetExtPropertiesEx
%>
<html>
Your download connection speed in bits per second is: <% = bhObj.ConnectionSpeed %> <br>
Your download connection latency in milliseconds is: <% = bhObj.ConnectionLatency %> <p>
Your download connection speed for nicely formatted display purposes is: <% = bhObj.Translate("ConnectionSpeed") %> <p>
</html>
Special notes for this property:
The ConnectionLatency test is not included when calling GetExtPropertiesEx with the "all" keyword. Therefore you must explicitly pass "ConnectionLatency" as a parameter to SetExtProperties to check for connection latency. If you do not call the GetExtPropertiesEx method prior to checking the ConnectionLatency property, the ConnectionLatency property will return -2.
Testing ConnectionLatency may increase your web hosting fees due to increased bandwidth usage. See Progressive Versus Original Speed Tests for more information and tips on reducing this bandwidth.
If you are already performing a ConnectionSpeed test using the Progressive testing method, then testing ConnectionLatency does not add any additional testing time, bandwidth or overhead to the testing process. This is because the ConnectionSpeed test detects latency as a standard part of the speed test. However if you are not explicitly testing ConnectionSpeed and only request ConnectionLatency, then a full Progressive ConnectionSpeed test is run (just as if you had explicitly requested it) because it is required to determine the latency.
In the event the ConnectionLatency test times out (as determined by SpeedCheckMaxWait) or an error occurs during testing, the ConnectionLatency property returns -1.
If the user’s JavaScript is disabled this property will not be available and a value of -2 is returned.
See Also:
Detecting Connection Speed and Dialup Users