What is the best way
Depends on the rest of the program. In .NET (noting the C # tag for a question), it's easy to access WMI and performance counters.
From the Win32 API, if you use COM, then WMI may be the easiest, since reading performance data requires significant template code (from any API you start with).
source share