code for timing studies