mirror of
https://github.com/curl/curl.git
synced 2026-08-05 04:36:14 +03:00
timeval: rename timer frequency variable
It's no longer a global variable.
Follow-up to 1027d07704 #22346
Closes #22347
This commit is contained in:
parent
1027d07704
commit
1128177a6f
1 changed files with 6 additions and 6 deletions
|
|
@ -27,24 +27,24 @@
|
|||
|
||||
#include "system_win32.h"
|
||||
|
||||
static LARGE_INTEGER Curl_freq;
|
||||
static LARGE_INTEGER s_time_freq;
|
||||
|
||||
/* For tool or tests, we must initialize before calling curlx_now().
|
||||
Providing this function here is wrong. */
|
||||
void curlx_now_init(void)
|
||||
{
|
||||
QueryPerformanceFrequency(&Curl_freq);
|
||||
QueryPerformanceFrequency(&s_time_freq);
|
||||
}
|
||||
|
||||
/* In case of bug fix this function has a counterpart in tool_util.c */
|
||||
void curlx_pnow(struct curltime *pnow)
|
||||
{
|
||||
LARGE_INTEGER count;
|
||||
DEBUGASSERT(Curl_freq.QuadPart);
|
||||
DEBUGASSERT(s_time_freq.QuadPart);
|
||||
QueryPerformanceCounter(&count);
|
||||
pnow->tv_sec = (time_t)(count.QuadPart / Curl_freq.QuadPart);
|
||||
pnow->tv_usec = (int)((count.QuadPart % Curl_freq.QuadPart) * 1000000 /
|
||||
Curl_freq.QuadPart);
|
||||
pnow->tv_sec = (time_t)(count.QuadPart / s_time_freq.QuadPart);
|
||||
pnow->tv_usec = (int)((count.QuadPart % s_time_freq.QuadPart) * 1000000 /
|
||||
s_time_freq.QuadPart);
|
||||
}
|
||||
|
||||
#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) || \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue