so I'm running a very rudimentary webcam surveillance program with PyGame, that just takes a picture from the webcam, stamps the time and saves it in an endless loop. (and does some simple date checking and sometimes writes to a log file)
I have put
time.sleep(1) at the end, because it's sufficient for my cause and of course I wanted to keep CPU usage low.
But whenever I check the CPU usage with
ps -o %cpu the CPU usage of
python is alternating between 35% and 55%. I feel like that's way too much for a program that only runs every second.
I also tried
pygame.time.delay(1) but that's not really better.
Am I missing something or is PyGame just not the best choice for my task?