Search code examples
c++windowswaitforsingleobject

Time passed till WaitForSingleObject returned


Is there a way to know how much time passed from when I called WaitForSingleObject function untill it returned?

or that the only way of knowing is by using some kind of a timer?


Solution

  • Just store current time before calling WaitForSingleObject(). Then compare to time when it returns.

    From http://msdn.microsoft.com/en-us/library/windows/desktop/ms725473(v=vs.85).aspx - select a function to retrieve time.