I'm not generally one to write about "cool code" just for the sake of cool code, but I'm pretty excited about this. I had an idea for a super-simple profiling system today. It's not particularly innovative or hard to code (it only took about 30 minutes to implement), but the results are incredibly handy.

Here's my real-time profiler output:

The numbers just indicate the cumulative time (in seconds) spent in a given function. And here's what enabling profiling for a function looks like:

One meager line to automatically profile a function? Not too bad 🙂