VirtualBox

Changeset 32905 in vbox


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

Introducing RTThreadGetExecutionTimeMilli

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/thread.h

    r28800 r32905  
    651651
    652652
     653/**
     654 * Get the execution times of the specified thread
     655 *
     656 * @returns IPRT status code.
     657 * @param   hThread             The thread handle.
     658 * @param   pKernelTime         Kernel execution time in ms (out)
     659 * @param   pUserTime           User execution time in ms (out)
     660 *
     661 */
     662RTR3DECL(int) RTThreadGetExecutionTimeMilli(RTTHREAD hThread, uint64_t *pKernelTime, uint64_t *pUserTime);
    653663
    654664/** @name Thread Local Storage
  • 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