in reply to sleep in infinite loop

It works, but you don't see the output because the output is line buffered, and you don't print a newline.

If you print "interval\n" instead it works as expected.