print state periodically.