Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 getaddrinfo() API 来解析跨平台 C++ 应用程序中的 DNS 查询。我需要知道 getaddrinfo() 在不同平台上的时间成本吗?谁可以帮我这个事?
这个函数没有算法复杂性,因为它内部没有做任何复杂的计算。您最好对正在使用的系统/平台进行测量,并以此为基础。
结果将根据您拥有的网络而大不相同。想象一下拨号连接速度较慢的系统。它的速度与位于同一 LAN 上的快速 LAN 和 DNS 服务器没有任何共同之处。