Java Script With An Example:Creating a timing event in an infinite loop