Update timer.js

Workaround to allow e2e tests ,we can't use $timout which make the e2e to hang.