Share via


GetCurrentProcessorNumber 函式 (processthreadsapi.h)

擷取在呼叫此函式期間,目前線程執行所在的處理器數目。

Syntax

DWORD GetCurrentProcessorNumber();

傳回值

函式會傳回目前的處理器編號。

備註

此函式可用來提供評估進程效能的資訊。

在超過 64 個邏輯處理器的系統上, GetCurrentProcessorNumber 函式會傳回指派邏輯處理器之 處理器群組內的處理器 編號。 使用 GetCurrentProcessorNumberEx 函 式來擷取目前處理器的處理器群組和數目。

規格需求

需求
最低支援的用戶端 Windows Vista [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2003 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 processthreadsapi.h (包括 Windows Vista 上的 Windows.h、Windows 7、Windows Server 2008 Windows Server 2008 R2)
程式庫 Kernel32.lib
DLL Kernel32.dll

另請參閱

多個處理器

處理序和執行緒函式

程序