VirtualBox

Changeset 32905 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Oct 5, 2010 11:43:35 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66388
Message:

Introducing RTThreadGetExecutionTimeMilli

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/thread-win.cpp

    r29251 r32905  
    223223}
    224224
     225
     226RTR3DECL(int) RTThreadGetExecutionTimeMilli(RTTHREAD hThread, uint64_t *pKernelTime, uint64_t *pUserTime)
     227{
     228    uint64_t u64CreationTime, u64ExitTime, u64KernelTime, u64UserTime;
     229
     230    if (GetThreadTimes(hThread, (LPFILETIME)&u64CreationTime, (LPFILETIME)&u64ExitTime, (LPFILETIME)&u64KernelTime, (LPFILETIME)&u64UserTime))
     231    {
     232        *pKernelTime = u64KernelTime / 10000;    /* GetThreadTimes returns time in 100 ns units */
     233        *pUserTime   = u64UserTime / 10000;    /* GetThreadTimes returns time in 100 ns units */
     234        return VINF_SUCCESS;
     235    }
     236
     237    int iLastError = GetLastError();
     238    AssertMsgFailed(("GetThreadTimes failed, LastError=%d\n", iLastError));
     239    return RTErrConvertFromWin32(iLastError);
     240}
Note: See TracChangeset for help on using the changeset viewer.

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