Added Time Coding

I am trying to make the window close after a number of seconds.