直到WaitForSingleObject返回的时间 [英] Time passed till WaitForSingleObject returned
本文介绍了直到WaitForSingleObject返回的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法知道从我调用WaitForSingleObject函数到返回它要经过多少时间?
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?
推荐答案
只需在调用WaitForSingleObject()
之前存储当前时间.然后与返回的时间进行比较.
Just store current time before calling WaitForSingleObject()
. Then compare to time when it returns.
来自 http://msdn.microsoft.com/zh-cn/library/windows/desktop/ms725473(v=vs.85).aspx -选择一个函数来检索时间.
From http://msdn.microsoft.com/en-us/library/windows/desktop/ms725473(v=vs.85).aspx - select a function to retrieve time.
这篇关于直到WaitForSingleObject返回的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文