rv = NS_AutoregisterComponents(); RETURN_IF_FAILED(rv, "NS_AutoregisterComponents");
int main(int argc, char **argv){    nsresult rv;     if (argc == 1) {        printf("usage: TestPageLoad <url>\n");        return -1;    }    PRTime start, finish;    rv = NS_NewISupportsArray(getter_AddRefs(uriList));    RETURN_IF_FAILED(rv, "NS_NewISupportsArray");    rv = NS_AutoregisterComponents();    RETURN_IF_FAILED(rv, "NS_AutoregisterComponents");    // Create the Event Queue for this thread...    nsCOMPtr<nsIEventQueueService> eqs =              do_GetService(kEventQueueServiceCID, &rv);    RETURN_IF_FAILED(rv, "do_GetService(EventQueueService)");    rv = eqs->CreateMonitoredThreadEventQueue();    RETURN_IF_FAILED(rv, "CreateMonitoredThreadEventQueue");    rv = eqs->GetThreadEventQueue(NS_CURRENT_THREAD, &gEventQ);    RETURN_IF_FAILED(rv, "GetThreadEventQueue");    printf("Loading necko ... \n");    nsCOMPtr<nsIChannel> chan;    nsCOMPtr<nsIStreamListener> listener = new MyListener();    nsCOMPtr<nsIInterfaceRequestor> callbacks = new MyNotifications();    rv = NS_NewURI(getter_AddRefs(baseURI), argv[1]);    RETURN_IF_FAILED(rv, "NS_NewURI");    rv = NS_OpenURI(getter_AddRefs(chan), baseURI, nsnull, nsnull, callbacks);    RETURN_IF_FAILED(rv, "NS_OpenURI");    gKeepRunning++;    //TIMER STARTED-----------------------    printf("Starting clock ... \n");    start = PR_Now();    rv = chan->AsyncOpen(listener, nsnull);    RETURN_IF_FAILED(rv, "AsyncOpen");    while (gKeepRunning) {        gEventQ->ProcessPendingEvents();    }    finish = PR_Now();    PRUint32 totalTime32;    PRUint64 totalTime64;    LL_SUB(totalTime64, finish, start);    LL_L2UI(totalTime32, totalTime64);     printf("\n\n--------------------\nAll done:\nnum found:%d\nnum start:%d\n", numFound, numStart);     printf("\n\n>>PageLoadTime>>%u>>\n\n", totalTime32);     return 0;}