Add time measurement and test cases