My program contains a child of a widget class, and the paint() function is redefined for the child.
The program is consuming a lot of CPU cycles even when idle. A printf() inside my paint() function shows that paint() is called only when I expect it to be called.
What else can I try to locate the source of the consumption?
Add
Let me step back to something truly elementary. In XCode 3 there used to be a build setting to choose between a “Debug” and a “Release” build, but I no longer see such a setting in XCode 4. How does one generate a debug build? Perhaps the answer to my original question would be as simple as pressing “pause” (another button that disappeared) while the program is in the idle loop. (The loop itself, I should add, belongs to the toolkit, not my code.)
Assuming this is MacOS Xcode development, you can use the profiler that comes with Xcode.
If not, use whatever profiler is available.
If no profiler is available, start slowly stripping out functionality out of your application. Or perhaps not slowly, but do a binary search (i.e. strip out half of functionality). Whatever is easier.
Depending on your application doing the 3rd things (i.e. ripping things out instead of using profiler) might actually be the fastest route to victory, but it’s worth to spend some time and learn to use profiler.