469,360 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

how to measure download/upload speed? (programming, C#)

Hello all,

I have a question, how do i measure the download/upload speed... as if download rate, upload rate or kbps transfer rate.
i want to do my own windows application using C# to measure the download speed.

the idea is this.
1. i will put a file at a serverA.
2. i download the file
3. i measure the speed of the download(how long it would take me to complete the download)

the question:
1. how do i calculate the transfer time? the speed..?
Jun 15 '07 #1
4 12326
kenobewan
4,871 Expert 4TB
Welcome to TSDN. One way would to take the time at the start and measure the datetime diff when finished. HTH.
Jun 15 '07 #2
Welcome to TSDN. One way would to take the time at the start and measure the datetime diff when finished. HTH.

hrm.. okay... i know how to measure the difference between two time..

but how do i set the starting point when the download start... and of course when the download completed.

DateTime startTime = DateTime.Now; <--- where should i put this?
DateTime stopTime = DateTime.Now; <--- and where should i put this?


i mean.. maybe start time i can put it when i click the download/upload button...
but how do i get the completed time?
Jun 22 '07 #3
kenobewan
4,871 Expert 4TB
I suggest placing them at the begining and end of the on click function, usually with a popup to say that the download has finished and a time diff before to calculate. HTH.
Jun 22 '07 #4
userkv
1
I'm facing a similar problem. Here is the scenario. I have a server component in C# from where files will be downloaded using a C# client.

Once the download starts, I need to show the current transfer rate and the estimated time to completely download the file. Again, I need to show this information as soon as the download starts and not at the end of the download process.

Also, is there any way to restrict the bandwidth for a socket programmatically?

Thanks in advance.
Aug 28 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by - - Pierre | last post: by
1 post views Thread by Serdar C. | last post: by
3 posts views Thread by Mike Kelly | last post: by
reply views Thread by Preben Zacho | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.