I don't know of any SQL way to do it, but some API's have functions to return information about the latest query, which may include time taken. In the C API, the mysql_info function returns information about update/insert/alter queries, but not for selects. However, it's probably clock time that gets reported, not CPU time.