Update test.js

add the function of assigning time