change interval to timer, add some test case, add gitignore