added time measurement code