Measure execution time by regions of code