write discovered hosts to a file, add optional delay parameter