Add timing measurments

Now records total time and time per thread in event processing.