I don't have much experience with python profiling, but this looks like a really easy way to get granular performance metrics. I could see this being quite useful in longer functions with multiple performance sensitive parts. I'll make sure to keep this profiling technique in mind next time I have to write Python.