简体   繁体   中英

C++ thread waiting times

Is there a way to get the time a thread has been WAITING during its life (in C++/windows)? (I've asked before about the working time, but getting the waiting time would be much better :) )

Using GetThreadTimes is not enough for me because I need a high resultion (way better than 100 microsec, more towards 5-10 microsec or even less.

  1. Call GetThreadTimes().
  2. Add together kernel time and user time.
  3. Subtract creation time from now.
  4. Subtract value found in step 2 from that found in step 3 and you have your answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM