Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

In my (Windows)application i am creating threads to process the data. These threads are not i/o centric. All threds work on the data in memory.

I want the cpu utilization when these threads run. I want to write it in log files. How to do it.Is there any API.

Thanks in advance.

1 solution

Concerning Windows API - go to MSDN Windows API overview, select Diagnistics->Performance Counters or Performance Logs and Alerts.
Windows SDK 7.0 has a sample in ...\Samples\WinBase\WinNT\PerfLogsAlert:
"This particular sample code collects the following data:
- Counter data: Processor(_Total)% Processor Time, Processor(_Total)% User Time"
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900