VirtualBox

Ignore:
Timestamp:
Nov 30, 2023 8:12:27 AM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160526
Message:

libs/xpcom: Convert the PR_Waitfunction to take the timeout in milliseconds and get rid of PR_Interval* and use RTTime*, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp

    r86423 r102390  
    4444#include "xptcall.h"
    4545#include "prlong.h"
    46 #include "prinrval.h"
    4746#include "nsMemory.h"
    4847
     
    5453
    5554#include <iprt/string.h>
     55#include <iprt/time.h>
    5656
    5757static char  g_szDirect[16384];
     
    14381438    static const int count = 100000000;
    14391439    int i;
    1440     PRIntervalTime start;
    1441     PRIntervalTime interval_direct;
    1442     PRIntervalTime interval_invoke;
     1440    uint64_t start;
     1441    uint64_t interval_direct;
     1442    uint64_t interval_invoke;
    14431443
    14441444    printf("Speed test...\n\n");
    14451445    printf("Doing %d direct call iterations...\n", count);
    1446     start = PR_IntervalNow();
     1446    start = RTTimeNanoTS();
    14471447    for(i = count; i; i--)
    14481448        (void)test->AddTwoInts(in1, in2, &out);
    1449     interval_direct = PR_IntervalNow() - start;
     1449    interval_direct = RTTimeNanoTS() - start;
    14501450
    14511451    printf("Doing %d invoked call iterations...\n", count);
    1452     start = PR_IntervalNow();
     1452    start = RTTimeNanoTS();
    14531453    for(i = count; i; i--)
    14541454        (void)XPTC_InvokeByIndex(test, 3, 3, var);
    1455     interval_invoke = PR_IntervalNow() - start;
     1455    interval_invoke = RTTimeNanoTS() - start;
    14561456
    14571457    printf(" direct took %0.2f seconds\n",
    1458             (double)interval_direct/(double)PR_TicksPerSecond());
     1458            (double)interval_direct/(double)RT_NS_1SEC);
    14591459    printf(" invoke took %0.2f seconds\n",
    1460             (double)interval_invoke/(double)PR_TicksPerSecond());
     1460            (double)interval_invoke/(double)RT_NS_1SEC);
    14611461    printf(" So, invoke overhead was ~ %0.2f seconds (~ %0.0f%%)\n",
    1462             (double)(interval_invoke-interval_direct)/(double)PR_TicksPerSecond(),
     1462            (double)(interval_invoke-interval_direct)/(double)RT_NS_1SEC,
    14631463            (double)(interval_invoke-interval_direct)/(double)interval_invoke*100);
    14641464}       
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette