There are a couple of features that could be used in this case. One is the Pause/Resume API, which would allow you to start collecting data when you wanted to (i.e., you add a call in your code to resume data collection and start the activity with data collection paused). The other is the Samples Over Time feature, which displays the number of samples collected within time slots. You can zoom in so that the time slots become finer and finer. Check out the online help for details.
What kind of timer are you using? You know that WM_TIMER messages have a low priority, right? As I understand it, multimedia timers are preferred for your type of application.
Thanks for responding and for your ideas.
I did not know about the Pause/Resume API, which sounds like it would be a perfect fit. I have to confess I was not even aware that there existed VTune APIs. But it sounds like I would start out by calling "Pause" and then when my code detects the start of the condition causing me problems, my code makes a "Resume" call and then about 2 seconds later, my code could "Pause" again. And this sequence of pausing and resuming would make VTune only focus on the activity when not paused. Also, I'm assuming that the Pause/Resume functionality is done with some sort of C or C++ call into a VTune library that Ilink my application against.
Does all this sound correct?
Does this VTune library come as part of the VTune for Windows package or is it a separate product/purchase?
With regards to your question about my timer, I am calling timeSetEvent from Microsoft's Multimedia PlatformSDK with the resolution set to 1 (for most accuracy), the delay set to 33 mS, and the flags are set to TIME_PERIODIC | TIME_CALLBACK_EVENT_SET, which means that every 33 mSec the event I specify should get signaled. My events get signaled with a periodicity of anywhere from 20 to 60 mSec as measured with calls to GetSystemTimeAsFileTime. I have no idea what I am doing wrong to make the timing of the timeSetEvent callbacks so inaccurate. BTW, the priority of the CWinThread method that calls the timeSetEvent function is created as THREAD_PRIORITY_HIGHEST. But I don't think this helps since the timeSetEvent code runs in its own OS-created thread, which I can't control or improve its priority.
Thanks again for your help.