curl 中的各种 time 关系

用 curl 相关的 api 编程, 请求 url 后可以获得 namelookup_time, connect_time, total_time 3个时间.

以前一直以为total_time 是 namelookup_time, connect_time 以及传输时间的和.

今天发现 case 中 namelookup_time, connect_time 相加已经大于 total_time .

在网上并没有搜到能够解释清楚的资料, 下载 curl 的源码看了下, 原来 3 个时间都是基于 curl 请求任务开始的时间点的, 也就是 connect_time 已经包含 namelookup_time. total_time 是请求完成所耗的时间.