Does anyone know what the function is to check the CPU usage?
Thanks
CPU usage function
Well unlike something like a PC operating system the PSP is not multiprocess or preemptive multitasking, therefore you can be reasonably certain that only your threads are running on the CPU at any one time (with a small amount taken up with interrupt traffic). Therefore to work out roughly what your usage is you can only really base it on your display speed.
Most apps will use the vblank timing (1/60th sec per frame) as the reference for their application, you can use the rtc functions to determine roughly how much cpu you use by measuring how much time elapses between the start of your main loop and just before calling the vblankwait routine. Any spare time in that frame is therefore unused from which you can work out a rough percentage.
Most apps will use the vblank timing (1/60th sec per frame) as the reference for their application, you can use the rtc functions to determine roughly how much cpu you use by measuring how much time elapses between the start of your main loop and just before calling the vblankwait routine. Any spare time in that frame is therefore unused from which you can work out a rough percentage.
How about the Profiler Hardwareregisters in "yet another PlayStationPortable Documentation" (page 48).
You could get the exact cycle count your function or program took then divide by the clock rate your PSP is currently running at.
You could get the exact cycle count your function or program took then divide by the clock rate your PSP is currently running at.
infj