Hello, I’d like to decrease the CPU usage of my application and, while trying some stuff, I saw that Panda was taking a lot of CPU, even when nothing is done.
def main():
import direct.directbase.DirectStart
from pandac.PandaModules import ClockObject, PStatClient
PStatClient.connect()
FPS = 60
globalClock = ClockObject.getGlobalClock()
globalClock.setMode(ClockObject.MLimited)
globalClock.setFrameRate(FPS)
base.win.setActive(False)
run()
if __name__ == '__main__':
main()
With this code sample, nothing is displayed, the fps is set to 60, and it’s using mor than 60% of my CPU. If I decrease the FPS, the CPU usage also decrease, but I can’t to that since my application relies a lot on the taskMgr.
Is there a way to decrease this CPU usage when nothing is displayed (or when the display doesn’t change), cause on a laptop, it will help to save batteries.
Thanks in advance.