1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLINFO_QUEUE_TIME_T
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_STARTTRANSFER_TIME_T (3)
9  - CURLOPT_TIMEOUT (3)
10  - curl_easy_getinfo (3)
11  - curl_easy_setopt (3)
12Protocol:
13  - All
14---
15
16# NAME
17
18CURLINFO_QUEUE_TIME_T - time this transfer was queued
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_QUEUE_TIME_T,
26                           curl_off_t *timep);
27~~~
28
29# DESCRIPTION
30
31Pass a pointer to a curl_off_t to receive the time, in microseconds, this
32transfer was held in a waiting queue before it started "for real". A transfer
33might be put in a queue if after getting started, it cannot create a new
34connection etc due to set conditions and limits imposed by the application.
35
36See also the TIMES overview in the curl_easy_getinfo(3) man page.
37
38# EXAMPLE
39
40~~~c
41int main(void)
42{
43  CURL *curl = curl_easy_init();
44  if(curl) {
45    CURLcode res;
46    curl_off_t queue;
47    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
48    res = curl_easy_perform(curl);
49    if(CURLE_OK == res) {
50      res = curl_easy_getinfo(curl, CURLINFO_QUEUE_TIME_T, &queue);
51      if(CURLE_OK == res) {
52        printf("Queued: %" CURL_FORMAT_CURL_OFF_T ".%06ld us", queue / 1000000,
53               (long)(queue % 1000000));
54      }
55    }
56    /* always cleanup */
57    curl_easy_cleanup(curl);
58  }
59}
60~~~
61
62# AVAILABILITY
63
64Added in 8.6.0
65
66# RETURN VALUE
67
68Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
69