🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
3 messages
3 total messages Started by Jens Harms Sat, 04 Dec 2004 16:38
time measuring with indy http
#1442
Author: Jens Harms
Date: Sat, 04 Dec 2004 16:38
36 lines
1755 bytes
hi all,

during loading a web site with tidhttp i like to get the execution time (the
time which is needed to load the whole document) and the response time (time
when the first byte arrived).

diff should get the execution time
and
responsediff should get the response time.

i use this code here

DWORD start,diff,responsediff;
getfirstbyte = false;
start = ::GetTickCount();
HTTP->Get(Url);
diff = ::GetTickCount()-start;

void __fastcall TMyThread::HTTPWorkBegin(TObject *Sender,
      TWorkMode AWorkMode, const int AWorkCountMax)
{
   if (getfirstbyte == false)
   {
      responsediff = ::GetTickCount()-start;
      getfirstbyte = true;
   }
}


My problem is that diff and responsediff always get the sam value. why is
that? i think time of responsediff should be much smaller than the time auf
diff.

Does anybody have any idea why my code works not correctly?

Jens
Re: time measuring with indy http
#1443
Author: hans galema
Date: Sat, 04 Dec 2004 17:39
29 lines
1916 bytes
Jens Harms wrote:

> during loading a web site with tidhttp i like to get the execution time (the
> time which is needed to load the whole document) and the response time (time
> when the first byte arrived).

First a remark. TidHTTP will not load a -whole- website but -only- one html page.

> diff should get the execution time
> and
> responsediff should get the response time.

Second remark. If you want to determine execution time and
response time then do not call variables for them diff and responsediff
but executiontime and responsetime. This makes your code readable.

> getfirstbyte = false;

Why do you need such a bool ? Are there more occurrences of
HTTPWorkBegin() ?

> My problem is that diff and responsediff always get the sam value. why is
> that? i think time of responsediff should be much smaller than the time auf
> diff.

Indeed. What is the value you get ? Is it a very small page ? Try with
a very large page.

Hans.
Re: time measuring with indy http
#1444
Author: Jens Harms
Date: Sat, 04 Dec 2004 18:29
20 lines
1521 bytes
Hi Hans,

> First a remark. TidHTTP will not load a -whole- website but -only- one
html page.

sorry, i meant one html page and not a whole website!

> Why do you need such a bool ? Are there more occurrences of
> HTTPWorkBegin() ?

Yeah, i tried and find out that it is called  more times, that is why i use
a boolean

> Indeed. What is the value you get ? Is it a very small page ? Try with
> a very large page.

The execution time value is okay. the response time value should be smaller,
but it isnt.

Jens
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads