I have defined a handler for EVT_IDLEwhich performs a specific background job for me. (This task is to complete the completed work of several processes and integrate it into any object, making visible changes in the graphical interface.)
The problem is that when the user does not move the mouse or does nothing, EVT_IDLEit is not called more than once. I would like this handler to work all the time. So I tried calling event.RequestMore()at the end of the handler. It works, but now it takes a lot of CPU. (I guess he just goes over this task too much.)
I am ready to limit the number of times a task will be executed per second; How to do it?
Or do you have another solution?
source
share