forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CPU usage function

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
youresam



Joined: 06 Nov 2005
Posts: 87

PostPosted: Mon Mar 20, 2006 12:36 pm    Post subject: CPU usage function Reply with quote

Does anyone know what the function is to check the CPU usage?

Thanks
Back to top
View user's profile Send private message AIM Address
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Mon Mar 20, 2006 3:38 pm    Post subject: Reply with quote

elaborate your question
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
youresam



Joined: 06 Nov 2005
Posts: 87

PostPosted: Tue Mar 21, 2006 7:13 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Mar 21, 2006 8:53 am    Post subject: Reply with quote

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
View user's profile Send private message
youresam



Joined: 06 Nov 2005
Posts: 87

PostPosted: Tue Mar 21, 2006 1:19 pm    Post subject: Reply with quote

Ok, thanks!
Back to top
View user's profile Send private message AIM Address
Saotome



Joined: 03 Apr 2004
Posts: 182

PostPosted: Tue Mar 21, 2006 10:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group