1var sleep = time => new Promise(resolve => setTimeout(resolve, time))
2var poll = (promiseFn, time) => promiseFn().then(
3 sleep(time).then(() => poll(promiseFn, time)))
4
5// Greet the World every second
6poll(() => new Promise(() => console.log('Hello World!')), 1000)
7