Terenz Posted June 3, 2016 Posted June 3, 2016 (edited) Hello, I need to read an XML from our internal website, for access require a token so i can't provide a valid link. There is something i don't understand: Sleep(1000) Local $begin = TimerInit() Local $sXML = "http://xml" $sReadXML = InetRead($sXML) Local $dif = TimerDiff($begin) ConsoleWrite("Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://xml" $sReadXML1 = InetRead($sXML1) Local $dif1 = TimerDiff($begin1) ConsoleWrite("Time Difference:" & $dif1 & @CRLF) The result are: Time Difference:4682.18418821387 Time Difference:2.10948598215695 Why so much difference for the same link? The first time require 4 seconds, the second time 2 ms! What? Any alternative for read a text from a website? Someone knows why so much difference? Thanks I have try with the different paramenter, second time is always faster: options = 1 Time Difference:7010.47647117162 Time Difference:4507.6871501825 options = 2 Time Difference:7011.62522052384 Time Difference:4506.94683262817 options = 4 Time Difference:6949.39328881185 Time Difference:4512.07178565991 options = 8 Time Difference:6935.37055687245 Time Difference:4507.37956919106 options = 16 Time Difference:4683.14995341587 Time Difference:2253.67860999093 options = 31 ( all parameter ) Time Difference:2424.24498085651 Time Difference:53.9141147827447 There is a way to speed up a bit the first time? Is just text! Edited June 3, 2016 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
AutoBert Posted June 3, 2016 Posted June 3, 2016 (edited) You are using the option Quote $INET_LOCALCACHE (0) = Get the file from local cache if available (default). so the 2. time the data is not downloaded it's from the cache. using this option Quote $INET_FORCERELOAD (1) = Forces a reload from the remote site. the rsults for all tries with same url will be nearly the same. Edited June 3, 2016 by AutoBert
Terenz Posted June 3, 2016 Author Posted June 3, 2016 (edited) As you can see i have try many parameters, also 1. 7 seconds vs 4,5 seconds is many times, also 4,5 seconds is many time for just a bunch of text. I'm checking _WinHttp but is complex to manage but it will take a couple of ms for do the same thing of InetRead! 100-200 ms vs seconds. Edited June 3, 2016 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
AutoBert Posted June 3, 2016 Posted June 3, 2016 38 minutes ago, Terenz said: As you can see i have try many parameters, also 1. may be but not in the code posted here: 1 hour ago, Terenz said: There is something i don't understand: Sleep(1000) Local $begin = TimerInit() Local $sXML = "http://xml" $sReadXML = InetRead($sXML) Local $dif = TimerDiff($begin) ConsoleWrite("Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://xml" $sReadXML1 = InetRead($sXML1) Local $dif1 = TimerDiff($begin1) ConsoleWrite("Time Difference:" & $dif1 & @CRLF) The result are: You must also know you and the server you are downloading are not the only in INet.
Terenz Posted June 3, 2016 Author Posted June 3, 2016 30 minutes ago, AutoBert said: may be but not in the code posted here Read under "I have try with the different paramenter, second time is always faster" there are all the ConsoleWrite with different parameter. Nothing is so strong as gentleness. Nothing is so gentle as real strength
AutoBert Posted June 3, 2016 Posted June 3, 2016 32 minutes ago, Terenz said: second time is always faster" there are all the ConsoleWrite with different parameter. with code i mean script code, and there is no script code which shows me you have tried with any other parameter than 0.
Terenz Posted June 3, 2016 Author Posted June 3, 2016 (edited) 1 hour ago, AutoBert said: with code i mean script code, and there is no script code which shows me you have tried with any other parameter than 0. Are you serius? I need to post the same code 7 times with only one little edit just for show you i have change the parameter? The ConsoleWrite for "proof" it is not enough? Do you want a video, a screenshot, a postal letter? I did not know whether to laugh or cry Edited June 3, 2016 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
AutoBert Posted June 3, 2016 Posted June 3, 2016 (edited) i only said there is no script code, so i could not verify. And even with script code the collapsed times are nothing worth. It's just a collapsed time in that moment and not more, as there a to many things that can be different from on moment to the next: may be a other process (AV?) need's resources and cputime, may be the internet traffic is different. etc. Ps.: options = 31 ( all parameter ) 4+8 at same is nonsence: Quote $INET_ASCIITRANSFER (4) = Use ASCII when transferring files with the FTP protocol (Can not be combined with flag $INET_BINARYTRANSFER (8)). $INET_BINARYTRANSFER (8) = Use BINARY when transferring files with the FTP protocol (Can not be combined with flag and in all other option cases without option=1 the second download is much to slow! In case option = 2,4,8,16 the cache is enabled. So i think your script did something wrong. Edited June 3, 2016 by AutoBert
Terenz Posted June 3, 2016 Author Posted June 3, 2016 No AV or other process, the internet traffic change in 1 second and get better? I have try all the parameter just for test, i know what they mean. I'll use WinHttp UDF if there aren't real suggestion. Sleep(1000) Local $begin = TimerInit() Local $sXML = "http://www.bing.com" $sReadXML = InetRead($sXML, 1+16) Local $dif = TimerDiff($begin) ConsoleWrite("Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://www.bing.com" $sReadXML1 = InetRead($sXML1, 1+16) Local $dif1 = TimerDiff($begin1) ConsoleWrite("Time Difference:" & $dif1 & @CRLF) Time Difference:2507.56953746915 Time Difference:144.535408829893 You can try it with whatever site or whatever parameter, second time is always faster on this machine and the code is only that, no errors. Nothing is so strong as gentleness. Nothing is so gentle as real strength
guinness Posted June 4, 2016 Posted June 4, 2016 (edited) Congrats on knowing what 1 and 16 is, as I couldn't tell without having to open up the help file. Anyway, the problem is your end. #include <InetConstants.au3> Sleep(1000) Local $begin = TimerInit() Local $sXML = "http://www.bing.com" Local $sReadXML = InetRead($sXML, BitOR($INET_FORCERELOAD, $INET_FORCEBYPASS)) Local $dif = TimerDiff($begin) ConsoleWrite("Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://www.bing.com" Local $sReadXML1 = InetRead($sXML1, BitOR($INET_FORCERELOAD, $INET_FORCEBYPASS)) Local $dif1 = TimerDiff($begin1) ConsoleWrite("Time Difference:" & $dif1 & @CRLF) ; Time Difference:337.463166201398 ; Time Difference:583.673162187312 Code highlighting is failing on this post Edited June 4, 2016 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Trong Posted June 4, 2016 Posted June 4, 2016 (edited) remove me! Edited June 5, 2016 by Trong short Regards,
Trong Posted June 4, 2016 Posted June 4, 2016 (edited) remove me! Edited June 5, 2016 by Trong short Regards,
guinness Posted June 4, 2016 Posted June 4, 2016 UEZ's script? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
mLipok Posted June 4, 2016 Posted June 4, 2016 (edited) Trong do you have any AV / Firewall program ? Please disable it and check again. Edited June 5, 2016 by mLipok typo Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Trong Posted June 4, 2016 Posted June 4, 2016 (edited) 4 hours ago, mLipok said: Trong to you have any AV / Firewall program ? ... My PC does not install any AV program! Edited June 5, 2016 by Trong ss Regards,
Terenz Posted June 5, 2016 Author Posted June 5, 2016 9 hours ago, guinness said: Congrats on knowing what 1 and 16 is, as I couldn't tell without having to open up the help file. Anyway, the problem is your end. Thanks, i'm know it because i'm using 3.3.8.1 for XP compatibility and some function has magic numbers. Also with the last stable the result is the same Time Difference:2724.19902529511 Time Difference:163.756566826231 I really don't know where the problem is since i don't have an AV or firewall on this machine Nothing is so strong as gentleness. Nothing is so gentle as real strength
AutoBert Posted June 5, 2016 Posted June 5, 2016 (edited) Test with this script: Sleep(1000) $aModes = StringSplit('0|1|2|3|4|5|6|7|8|9|10|11|16|17|18|19|20|21|22|24|25|26|27', '|', 2) For $i = 0 To UBound($aModes) - 1 InetTest($aModes[$i]) ConsoleWrite(@CRLF) Sleep(1000) Next Func InetTest($iMode) $bReloadForced=BitAND(1,$iMode) ConsoleWrite($iMode&' INET_FORCERELOAD: '&$bReloadForced&@CRLF) Local $begin = TimerInit() Local $sXML = "http://www.bing.com" Local $sReadXML = InetRead($sXML, $iMode) Local $dif = TimerDiff($begin) ConsoleWrite($iMode & " 1. Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://www.bing.com" Local $sReadXML1 = InetRead($sXML1, $iMode) Local $dif1 = TimerDiff($begin1) ConsoleWrite($iMode & " 2. Time Difference:" & $dif1 & @CRLF) EndFunc ;==>InetTest the base script is from @guinness. I think the peaks in 1. Difference depending on OS or AV will only happen in mode 0. In the rest of the modes when INET_FORCERELOAD=0 the 2. Difference should be the shorter. If INET_FORCERELOAD=1 it will be depend on the circumstances which happens on the way between bing and you so some times 1. Time is faster, sometimes 2. time is faster. my poor results: expandcollapse popup0 INET_FORCERELOAD: 0 0 1. Time Difference:9688.56364068073 0 2. Time Difference:13047.0886701367 1 INET_FORCERELOAD: 1 1 1. Time Difference:11553.4909142342 1 2. Time Difference:9405.162499304 2 INET_FORCERELOAD: 0 2 1. Time Difference:9746.07855749028 2 2. Time Difference:12095.4381410804 3 INET_FORCERELOAD: 1 3 1. Time Difference:9498.35295894589 3 2. Time Difference:11232.1294285628 4 INET_FORCERELOAD: 0 4 1. Time Difference:12150.3533762262 4 2. Time Difference:9736.52591137658 5 INET_FORCERELOAD: 1 5 1. Time Difference:10216.4686185399 5 2. Time Difference:10894.3928924115 6 INET_FORCERELOAD: 0 6 1. Time Difference:10093.4662998184 6 2. Time Difference:9597.36230231187 7 INET_FORCERELOAD: 1 7 1. Time Difference:8876.71864109993 7 2. Time Difference:11246.6049578272 8 INET_FORCERELOAD: 0 8 1. Time Difference:9656.64170025069 8 2. Time Difference:11562.6122000718 9 INET_FORCERELOAD: 1 9 1. Time Difference:11011.6217674379 9 2. Time Difference:9261.8331275732 10 INET_FORCERELOAD: 0 10 1. Time Difference:11883.7394455932 10 2. Time Difference:10472.3939023321 11 INET_FORCERELOAD: 1 11 1. Time Difference:11076.1184487158 11 2. Time Difference:8744.08879621683 16 INET_FORCERELOAD: 0 16 1. Time Difference:11666.8337067736 16 2. Time Difference:11275.4952163169 17 INET_FORCERELOAD: 1 17 1. Time Difference:10741.5025545616 17 2. Time Difference:9718.20909965382 18 INET_FORCERELOAD: 0 18 1. Time Difference:10112.6970321261 18 2. Time Difference:12612.8323922127 19 INET_FORCERELOAD: 1 19 1. Time Difference:11331.4728521426 19 2. Time Difference:8422.91099066303 20 INET_FORCERELOAD: 0 20 1. Time Difference:10202.7476497585 20 2. Time Difference:11933.7221975822 21 INET_FORCERELOAD: 1 21 1. Time Difference:10915.9506662084 21 2. Time Difference:10404.1192986364 22 INET_FORCERELOAD: 0 22 1. Time Difference:11908.056261156 22 2. Time Difference:9893.96729213907 24 INET_FORCERELOAD: 0 24 1. Time Difference:10901.7605771268 24 2. Time Difference:11382.6184848758 25 INET_FORCERELOAD: 1 25 1. Time Difference:9363.93943292124 25 2. Time Difference:10170.0033088021 26 INET_FORCERELOAD: 0 26 1. Time Difference:11605.385987447 26 2. Time Difference:10018.081291572 27 INET_FORCERELOAD: 1 27 1. Time Difference:11455.0601312385 27 2. Time Difference:11087.7542961628 +>15:46:47 AutoIt3.exe ended.rc:0 are the result of my poor INet with max 64 kBit/sec. Edited June 5, 2016 by AutoBert
Bowmore Posted June 5, 2016 Posted June 5, 2016 @Terenz This may or not be relevant, but it if your network administrators have implemented a network-integrated cache then even if you bypass the local cache on your PC the URL is still being returned from the network cache on the second call from InetRead() "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
Trong Posted June 5, 2016 Posted June 5, 2016 41 minutes ago, AutoBert said: Test with this script: Sleep(1000) $aModes = StringSplit('0|1|2|3|4|5|6|7|8|9|10|11|16|17|18|19|20|21|22|24|25|26|27', '|', 2) For $i = 0 To UBound($aModes) - 1 InetTest($aModes[$i]) ConsoleWrite(@CRLF) Sleep(1000) Next Func InetTest($iMode) $bReloadForced=BitAND(1,$iMode) ConsoleWrite($iMode&' INET_FORCERELOAD: '&$bReloadForced&@CRLF) Local $begin = TimerInit() Local $sXML = "http://www.bing.com" Local $sReadXML = InetRead($sXML, $iMode) Local $dif = TimerDiff($begin) ConsoleWrite($iMode & " 1. Time Difference:" & $dif & @CRLF) Sleep(1000) Local $begin1 = TimerInit() Local $sXML1 = "http://www.bing.com" Local $sReadXML1 = InetRead($sXML1, $iMode) Local $dif1 = TimerDiff($begin1) ConsoleWrite($iMode & " 2. Time Difference:" & $dif1 & @CRLF) EndFunc ;==>InetTest ................... My network speed: 14Mbps expandcollapse popup0 INET_FORCERELOAD: 0 0 1. Time Difference:354.322616200536 0 2. Time Difference:147.952567447931 1 INET_FORCERELOAD: 1 1 1. Time Difference:139.389442738264 1 2. Time Difference:131.764691644658 2 INET_FORCERELOAD: 0 2 1. Time Difference:135.886367423541 2 2. Time Difference:135.370168842086 3 INET_FORCERELOAD: 1 3 1. Time Difference:133.638180635059 3 2. Time Difference:133.820642171516 4 INET_FORCERELOAD: 0 4 1. Time Difference:132.703996186926 4 2. Time Difference:134.415038554309 5 INET_FORCERELOAD: 1 5 1. Time Difference:137.986536945203 5 2. Time Difference:136.312266162974 6 INET_FORCERELOAD: 0 6 1. Time Difference:136.046952194147 6 2. Time Difference:135.577299923012 7 INET_FORCERELOAD: 1 7 1. Time Difference:134.734346243108 7 2. Time Difference:134.582605271463 8 INET_FORCERELOAD: 0 8 1. Time Difference:171.970929036426 8 2. Time Difference:136.444923147387 9 INET_FORCERELOAD: 1 9 1. Time Difference:174.683182538803 9 2. Time Difference:135.18491452701 10 INET_FORCERELOAD: 0 10 1. Time Difference:157.972591670631 10 2. Time Difference:136.237792066461 11 INET_FORCERELOAD: 1 11 1. Time Difference:130.461394955683 11 2. Time Difference:135.45348673756 16 INET_FORCERELOAD: 0 16 1. Time Difference:143.438506273046 16 2. Time Difference:136.046952194147 17 INET_FORCERELOAD: 1 17 1. Time Difference:137.238537738352 17 2. Time Difference:133.469682991699 18 INET_FORCERELOAD: 0 18 1. Time Difference:139.101786540483 18 2. Time Difference:134.972197888846 19 INET_FORCERELOAD: 1 19 1. Time Difference:130.764876898973 19 2. Time Difference:134.751568377926 20 INET_FORCERELOAD: 0 20 1. Time Difference:134.975456130568 20 2. Time Difference:133.880221448726 21 INET_FORCERELOAD: 1 21 1. Time Difference:136.164248896154 21 2. Time Difference:133.116861959469 22 INET_FORCERELOAD: 0 22 1. Time Difference:159.328485690268 22 2. Time Difference:132.943709685077 24 INET_FORCERELOAD: 0 24 1. Time Difference:141.82428023113 24 2. Time Difference:133.95050637731 25 INET_FORCERELOAD: 1 25 1. Time Difference:134.52116414184 25 2. Time Difference:134.941942787137 26 INET_FORCERELOAD: 0 26 1. Time Difference:136.660898027274 26 2. Time Difference:134.547695538722 27 INET_FORCERELOAD: 1 27 1. Time Difference:137.625803040219 Regards,
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