trace.begin() and trace.end() can be used to compute timings.