| View previous topic :: View next topic |
| Author |
Message |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Mon Mar 20, 2006 12:36 pm Post subject: CPU usage function |
|
|
Does anyone know what the function is to check the CPU usage?
Thanks |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Mon Mar 20, 2006 3:38 pm Post subject: |
|
|
elaborate your question _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Tue Mar 21, 2006 7:13 am Post subject: |
|
|
| Well, I hear people sometimes say "It uses 20% CPU!", or a good example, that "fake hardscroll" that uses 1% CPU. How do they know how much CPU they are using? |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Mar 21, 2006 8:53 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Tue Mar 21, 2006 1:19 pm Post subject: |
|
|
| Ok, thanks! |
|
| Back to top |
|
 |
Saotome

Joined: 03 Apr 2004 Posts: 182
|
Posted: Tue Mar 21, 2006 10:11 pm Post subject: |
|
|
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. _________________ infj |
|
| Back to top |
|
 |
|