PDH API Question?

Hi experts,

I am trying to use the pdh.dll to obtain performance information of CPU and memory usage of my program.

I learn it from MSDN. But one area that I am not very clear.

My questions are:
1) When I call the method "PdhCollectQueryData", does it started collecting real time data from the OS and dump it into my buffer? or just a snap shot of the system measurement?

2) Continue from previous question, so if it is collecting data, when I call PdhGetFormateedCounterValue, it will format the collected value or just format the snap shot value?

3) since I want to measure my program, I would like it to provide me how much CPU and memory usage for this method. So if it is snap shot, it is not that appropriated. Is there other way to obtain this information?

Thank you for reading this message.

Best regards

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!