How do I find the speed of an in-progress file upload in cURL?

Posted by cinek1lol on Stack Overflow See other posts from Stack Overflow or by cinek1lol
Published on 2010-04-15T20:44:06Z Indexed on 2010/04/16 12:33 UTC
Read the original article Hit count: 167

Filed under:
|

I'd like to know how to check out the speed of a file being uploaded in real time using the cURL library in C++. This is what I have written:

void progress_func(void* ptr, double TotalToDownload, double NowDownloaded, 
                   double TotalToUpload,double NowUploaded)
{
    cout<<NowUploaded<<endl;
}
//...
int main()
{
//...
    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
}

But the manual says that it shows average speed, but even this doesn't seem to work with me, because too mach fast is end.

How to good write or A well-calculated?

© Stack Overflow or respective owner

Related posts about curl

Related posts about c++