Re: [twsocket] Download time
Thank you for your reply. I am unfamiliar with GetTickCount. Is that an API or something? It doesn't seem to be associated with THttpCli. Can you give me a small example of how to use GetTickCount. Thank you. I'm using a ThttpCli to download a 500kb file from my server. I could go bigger, but I have a 6000mb transfer limit per month on my server. I would rather do this another way, but this is the only way I know of. Still, doing it this way, I can't figure out how to determine the time it took to download the file. I hope this makes sense to someone. Use GetTickCount just before starting your download and GetTickCount from the OnRequestDone event. You'll have an exact measure of the time in milli-seconds (be aware GetTickCount wrap back to 0 after approximatively 49 days of up time). Given the size of the download you've done, you can compute the thruput with very simple math. You can also start a download of a large file and stop it after, let's say 15 seconds using Abort. Looking at the received size during 15 seconds, you can compute the mean thruput during those 15 seconds. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: G. M. Faggiano [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, September 01, 2005 3:58 AM Subject: [twsocket] Download time Hello, I'm trying to write a little app that downloads a file from my server at regular intervals and tells me what my true connection speed is. I'm doing this because I use a broadband connection through my lan. So, I have no real way to check my current speed without going to one of those online speed tests. I just want to represent my speed in mps via an icon in my system tray. If anyone has a better Idea on how to get the result I'm after, please tell me. Here is what I'm doing now. I'm using a ThttpCli to download a 500kb file from my server. I could go bigger, but I have a 6000mb transfer limit per month on my server. I would rather do this another way, but this is the only way I know of. Still, doing it this way, I can't figure out how to determine the time it took to download the file. I hope this makes sense to someone. Also, Francois, your components are awesome! I've been using them for about two years now. I'll be sure to send you a post card. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download time
Angus Robertson - Magenta Systems Ltd wrote: I am unfamiliar with GetTickCount. Is that an API or something? it also wraps after 49 days, so some care is needed for applications that run longer without a reboot. For calculating ticks elapsed I use this function: function CalcTicksAppart(const T1: DWORD): DWORD; var T2 : DWORD; begin T2 := GetTickCount; if T2 = T1 then Result := T2 - T1 else Result := MAXDWORD - T1 + T2; end; -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download time
I'm using a ThttpCli to download a 500kb file from my server. I could go bigger, but I have a 6000mb transfer limit per month on my server. I would rather do this another way, but this is the only way I know of. Still, doing it this way, I can't figure out how to determine the time it took to download the file. I hope this makes sense to someone. Use GetTickCount just before starting your download and GetTickCount from the OnRequestDone event. You'll have an exact measure of the time in milli-seconds (be aware GetTickCount wrap back to 0 after approximatively 49 days of up time). Given the size of the download you've done, you can compute the thruput with very simple math. You can also start a download of a large file and stop it after, let's say 15 seconds using Abort. Looking at the received size during 15 seconds, you can compute the mean thruput during those 15 seconds. -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: G. M. Faggiano [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, September 01, 2005 3:58 AM Subject: [twsocket] Download time Hello, I'm trying to write a little app that downloads a file from my server at regular intervals and tells me what my true connection speed is. I'm doing this because I use a broadband connection through my lan. So, I have no real way to check my current speed without going to one of those online speed tests. I just want to represent my speed in mps via an icon in my system tray. If anyone has a better Idea on how to get the result I'm after, please tell me. Here is what I'm doing now. I'm using a ThttpCli to download a 500kb file from my server. I could go bigger, but I have a 6000mb transfer limit per month on my server. I would rather do this another way, but this is the only way I know of. Still, doing it this way, I can't figure out how to determine the time it took to download the file. I hope this makes sense to someone. Also, Francois, your components are awesome! I've been using them for about two years now. I'll be sure to send you a post card. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download time
- Original Message - From: G. M. Faggiano [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, September 01, 2005 2:58 AM Subject: [twsocket] Download time Hello, I'm trying to write a little app that downloads a file from my server at regular intervals and tells me what my true connection speed is. I'm doing this because I use a broadband connection through my lan. So, I have no real way to check my current speed without going to one of those online speed tests. I just want to represent my speed in mps via an icon in my system tray. If anyone has a better Idea on how to get the result I'm after, please tell me. Here is what I'm doing now. I'm using a ThttpCli to download a 500kb file from my server. I could go bigger, but I have a 6000mb transfer limit per month on my server. I would rather do this another way, but this is the only way I know of. Still, doing it this way, I can't figure out how to determine the time it took to download the file. I hope this makes sense to someone. Also, Francois, your components are awesome! I've been using them for about two years now. I'll be sure to send you a post card. Use GetTickCount when you start the transfer and store the value somewhere. When the request is complete, if the download was successful, use GetTickCount again, subtract the original value and you have the tick taken in milliseconds. Are you using cable or some form of DSL? Maybe the modem has a way to get the connection speed, via snmp or by looking at its configuration pages. Dan -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be