! eof() is super slow - see test results

Blitz3D Forums/Blitz3D Programming/! eof() is super slow - see test results

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

With EOF = 997ms
Start=MilliSecs()
www=OpenTCPStream("www.blitzbasic.com",80)
If Not www RuntimeError "Failed to connect"
WriteLine www,"GET <a href="http://www.blitzbasic.com" target="_blank">http://www.blitzbasic.com</a> HTTP/1.0"
WriteLine www,"Host: www.blitzbasic.com HTTP/1.0"
WriteLine www,"User-Agent: ZquareTest"
WriteLine www,"Accept: */*"
WriteLine www, Chr$(10)
While Not Eof(www)
Print ReadLine(www)
Wend
CloseTCPStream www

Print MilliSecs()-Start
WaitKey()


without EOF: 667ms
Start=MilliSecs()

www=OpenTCPStream("www.blitzbasic.com",80)
If Not www RuntimeError "Failed to connect"
WriteLine www,"GET <a href="http://www.blitzbasic.com" target="_blank">http://www.blitzbasic.com</a> HTTP/1.1"
WriteLine www,"Host: www.blitzbasic.com"
WriteLine www,"User-Agent: ZquareTest"
WriteLine www,"Accept: */*"
WriteLine www,""
;or for loop etc.
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)

CloseTCPStream www

Print MilliSecs()-Start
WaitKey()


Hardly a major difference.