VirtualBox

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


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

Introducing RTThreadGetExecutionTimeMilli

Location:
trunk/src/VBox/Runtime/r3
Files:
3 edited

Legend:

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

    r28800 r32905  
    293293}
    294294
     295
     296RTR3DECL(int) RTThreadGetExecutionTimeMilli(RTTHREAD hThread, uint64_t *pKernelTime, uint64_t *pUserTime)
     297{
     298    return VERR_NOT_IMPLEMENTED;
     299}
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r29250 r32905  
    387387#endif
    388388
     389RTR3DECL(int) RTThreadGetExecutionTimeMilli(RTTHREAD hThread, uint64_t *pKernelTime, uint64_t *pUserTime)
     390{
     391    return VERR_NOT_IMPLEMENTED;
     392}
  • 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