SHOW PROFILES
The SHOW PROFILES statement,
together with SHOW PROFILE,
displays profiling information that indicates resource usage for
statements executed during the course of the current session.
For more information, see Section 13.7.5.32, “SHOW PROFILE Syntax”.

User Comments
The disclaimer about getrusage() should be more explicit. You cannot get per-thread resource stats from getrusage() on Linux today. PeterG provides some details on this -- http://blogs.mysql.com/peterg/2008/11/06/show-profile-information_schemaprofiling/
Open PHP MyProfiler (http://www.php-trivandrum.org/open-php-myprofiler) is just a trial to run query profiling on a php-mysql application, without changing the architecture too much. Thanks to the built in profiler
Add your own comment.