00001 #ifndef HEADER_CURL_TIMEVAL_H 00002 #define HEADER_CURL_TIMEVAL_H 00003 /*************************************************************************** 00004 * _ _ ____ _ 00005 * Project ___| | | | _ \| | 00006 * / __| | | | |_) | | 00007 * | (__| |_| | _ <| |___ 00008 * \___|\___/|_| \_\_____| 00009 * 00010 * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. 00011 * 00012 * This software is licensed as described in the file COPYING, which 00013 * you should have received as part of this distribution. The terms 00014 * are also available at https://curl.haxx.se/docs/copyright.html. 00015 * 00016 * You may opt to use, copy, modify, merge, publish, distribute and/or sell 00017 * copies of the Software, and permit persons to whom the Software is 00018 * furnished to do so, under the terms of the COPYING file. 00019 * 00020 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 00021 * KIND, either express or implied. 00022 * 00023 ***************************************************************************/ 00024 00025 /* 00026 * CAUTION: this header is designed to work when included by the app-side 00027 * as well as the library. Do not mix with library internals! 00028 */ 00029 00030 #include "curl_setup.h" 00031 00032 struct timeval curlx_tvnow(void); 00033 00034 /* 00035 * Make sure that the first argument (t1) is the more recent time and t2 is 00036 * the older time, as otherwise you get a weird negative time-diff back... 00037 * 00038 * Returns: the time difference in number of milliseconds. 00039 */ 00040 time_t curlx_tvdiff(struct timeval t1, struct timeval t2); 00041 00042 /* 00043 * Same as curlx_tvdiff but with full usec resolution. 00044 * 00045 * Returns: the time difference in seconds with subsecond resolution. 00046 */ 00047 double curlx_tvdiff_secs(struct timeval t1, struct timeval t2); 00048 00049 time_t Curl_tvlong(struct timeval t1); 00050 00051 /* These two defines below exist to provide the older API for library 00052 internals only. */ 00053 #define Curl_tvnow() curlx_tvnow() 00054 #define Curl_tvdiff(x,y) curlx_tvdiff(x,y) 00055 #define Curl_tvdiff_secs(x,y) curlx_tvdiff_secs(x,y) 00056 00057 #endif /* HEADER_CURL_TIMEVAL_H */ 00058