print a message periodically.