Windows API Reference

System Performance

This section provides information about Windows API functions that allow you to query and monitor the performance of the system. You can gather data on CPU usage, memory utilization, disk activity, and more to understand and optimize your application's behavior.

Core Concepts

Understanding system performance involves monitoring key resources:

  • CPU Usage: The percentage of time the processor is busy executing tasks.
  • Memory Usage: How much physical and virtual memory is being consumed by processes and the system.
  • Disk I/O: The rate at which data is read from or written to storage devices.
  • Network Activity: Data transfer rates and connection status.

Key API Functions

GetSystemInfo

VOID GetSystemInfo( LPSYSTEM_INFO lpSystemInfo );

The GetSystemInfo function retrieves information about the current system, including the architecture of the processor, a number of processors on the computer, the page size, and the size of the memory blocks that the memory allocation functions can use.

GlobalMemoryStatusEx

BOOL GlobalMemoryStatusEx( _Inout_ LMEMORYSTATUSEX lpBuffer );

The GlobalMemoryStatusEx function retrieves information about the current computer's memory utilization, including information about the extended memory available for the specified process.

GetProcessTimes

BOOL GetProcessTimes( HANDLE hProcess, LPFILETIME lpCreationTime, LPFILETIME lpExitTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime );

The GetProcessTimes function retrieves timing information for the specified process. This includes user-mode time, kernel-mode time, creation time, and exit time.

Performance Data Structures

Structure Name Description
SYSTEM_INFO Contains information about the current computer.
MEMORYSTATUSEX Contains information about the current computer's memory utilization.
FILETIME Represents a date and time value. Used by GetProcessTimes.
PERFORMANCE_DATA Structure used to retrieve performance counter data.

Related Topics