Skip to content

Download/Upload speed is not accurate. #2200

Closed
@julian0427

Description

@julian0427

I did this

double download_speed = 0;
double timeval = 0;
double downloadSize = 0;
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &downloadSize);
curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &timeval);
curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &download_speed);
printf("size: %f, time: %f, download speed: %f\n", downloadSize, timeval, download_speed);

When the elapsed time is much less than 1 seconds, the average download speed above is much less than actual. e.g.,
size: 14613.000000, time: 0.187000, download speed: 14613.000000

I expected the following

size: 14613.000000, time: 0.187000, download speed: 78144.385026

curl/libcurl version

7.56.1, 7.57.0
[curl -V output]

operating system

Windows7, Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions