What HTML Document Events should I connect to, to measure time that asnchronous request took?
In synchronous request I am using BeforeNavigate2 and OnDocumentComplete events. In BeforeNavigate2 I am setting start time and finally in OnDocumentComplete I measure time that elapsed from start time.
Which html document events should I use to do similar measurement of asynchronous request.
EDIT:
Xaenec, I thought about connecting to events this way:
public void OnDocumentComplete(object pDisp, ref object URL)
{
HTMLDocument doc = webBrowser.Document as HTMLDocument;
if (doc != null)
{
HTMLDocumentEvents2_Event events = (doc as HTMLDocumentEvents2_Event);
try
{
events.onreadystatechange += new HTMLDocumentEvents2_onreadystatechangeEventHandler(events_onreadystatechange);
}
catch
{
events.onreadystatechange -= new HTMLDocumentEvents2_onreadystatechangeEventHandler(events_onreadystatechange);
}
}
}
I do not know which event should I connect to, so I could make time stamp of begin async request and which event should I connect to to make time stamp of end async request.
I think you should use the callback of your asynchronous request, to measure the time when it is finished. If I missunderstand your question please give more details.