472,353 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 12695
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

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

Similar topics

4
by: - - Pierre | last post by:
Hi all, I'm trying to come up with a script and I'm having a heck of a time... I require users to enter the size (in MB or KB) of the...
1
by: Serdar C. | last post by:
i am trying to write a program to control upload and download speeds over specific ports like i have 128kbit download and 64kbit upload speed...
3
by: Gary O'Malley | last post by:
Everytime I download a file from the web I get a nice animated dialogue box that shows the size of the file, how much has been received and the...
3
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on...
0
by: Preben Zacho | last post by:
Anyone has a simple (if possible) code example that demonstrates how to measure the down- and upload speed of your internet connection? Cheers ...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to...
2
dlite922
by: dlite922 | last post by:
I have an intranet LAMP server and I use PHP to upload files. It is of course faster to download the same file than to upload it. I understand...
5
dlite922
by: dlite922 | last post by:
Before you jump in front of the train, no I don't mean ISP wise. I know providers throttle speed towards download. This is in a two PC LAN and...
4
by: nestle | last post by:
I have DSL with a download speed of 32MB/s and an upload speed of 8MB/s(according to my ISP), and I am using a router. My upload speed is always...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.