cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to measure current speed ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 16 Dec 2009 16:50:36 +0100 (CET)

On Wed, 16 Dec 2009, winuser wrote:

> Hello, i have simply question. How to measure current upload / download
> speed ? Not average, after end of upload. Anyone has suggestions ? Becouse
> if i calculate the speed in progress_callback function, i got value with
> resolution ~ 16 3xx bytes / s So how to get higher resolution ?

First, you're definately doing something wrong. The progress callback provides
a much higher resolution that that.

Secondly, you can easily count everything yourself in the write function.

> When i`m trying to get info in another thread (curl_easy_getinfo function
> with CURLINFO_SIZE_UPLOAD) i got randomly values.

That's a big nono.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-16