Here's an interesting snippet taken from the validation code in the new Discover DevTools course prepared by Google and CodeSchool (check it out, btw, it's awesome!):

function () { console.profile(); console.profileEnd(); if(console.clear) { console.clear() }; return console.profiles.length > 0; }

It exploits the fact that CPU profiles aren't actually run if DevTools are closed. Looks hacky but it works!

P.S. The same trick is also reported to work with Firefox+Firebug.