网站首页  词典首页

请输入您要查询的函数:

 

术语 querythreadcycletime
释义 QueryThreadCycleTime
语法:
C++
BOOL WINAPI QueryThreadCycleTime(
__in HANDLE ThreadHandle,
__out PULONG64 CycleTime
);
QueryThreadCycleTime功能
检索指定线程的周期时间。
参数
ThreadHandle [in]
句柄到线程。句柄必须有PROCESS_QUERY_INFORMATION或PROCESS_QUERY_LIMITED_INFORMATION访问权限。有关更多信息,请参见过程的安全性和访问权限。
CycleTime [out]
在CPU时钟由线程使用的周期数。此值既包括用户模式和内核模式下的周期。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
要枚举该进程的线程,使用Thread32First和Thread32Next功能。要获得线程处理线程标识符,使用OpenThread功能。
不要试图转换CPU时钟由QueryThreadCycleTime返回所用的时间周期。此函数使用的CPU的,它可以提供不同的服务在执行计时器。例如,一些CPU将改变定时器的频率时改变的频率运行的CPU和其他人将离开固定利率了。每个CPU的行为描述由CPU供应商提供的文件。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0600或更高版本。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
QueryIdleProcessorCycleTime
QueryProcessCycleTime
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==QueryThreadCycleTime Function
Retrieves the cycle time for the specified thread.
Syntax
C++
BOOL WINAPI QueryThreadCycleTime(
__in HANDLE ThreadHandle,
__out PULONG64 CycleTime
);
Parameters
ThreadHandle [in]
A handle to the thread. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights .
CycleTime [out]
The number of CPU clock cycles used by the thread. This value includes cycles spent in both user mode and kernel mode.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
To enumerate the threads of the process, use the Thread32First and Thread32Next functions. To get the thread handle for a thread identifier, use the OpenThread function.
Do not attempt to convert the CPU clock cycles returned by QueryThreadCycleTime to elapsed time. This function uses timer services provided by the CPU, which can vary in implementation. For example, some CPUs will vary the frequency of the timer when changing the frequency at which the CPU runs and others will leave it at a fixed rate. The behavior of each CPU is described in the documentation provided by the CPU vendor.
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
QueryIdleProcessorCycleTime
QueryProcessCycleTime
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684943(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:32