flush to stdout every second.