This function attaches a timer to the window.
value
If the function was successful, the return value is 1. Otherwise, the function returns 0.