How do I find the speed of an in-progress file upload in cURL?
- by cinek1lol
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?