added timer function in test.js