473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Calculating time required to recieve packets...

Greets all,

i am in the process of writing a simple client/server file upload
program that sends data via UDP packets. I have the process of
opening.sending, recieving & writing all working (via a stop/wait arq)
now what i would ideally like to do is time how long hte transfer took
place, ie from the moment that the first packet was recieved until the
last, so that i can calculted the transfer rate. (also i would liek
to implement a timeout/resend if packets get lost) but i dont even
know wehre to begin. ive been looking at struct timeval but can find
any resonable examples for this. anyone have any idea?

thanks.

Cheers,
Adam.
Jul 22 '05 #1
4 1468
* Adam Balgach:


OT

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #2
al***@start.no (Alf P. Steinbach) wrote in message news:<41***************@news.individual.net>...
* Adam Balgach:


OT

what does that mean?
Jul 22 '05 #3

"Adam Balgach" <ff**@hotmail.com> wrote in message
news:a5**************************@posting.google.c om...
al***@start.no (Alf P. Steinbach) wrote in message
news:<41***************@news.individual.net>...
* Adam Balgach:
>


OT

what does that mean?


Off Topic. Your question is not a topic that is discussed on this group.
Here we discuss the C++ language, not network programming. Have a look at
this groups welcome message http://www.slack.net/~shiva/welcome.txt which
has suggestions for other groups that might be more suitable for your
question.

john
Jul 22 '05 #4
>>>
OT

what does that mean?


Off Topic. Your question is not a topic that is discussed on this group.
Here we discuss the C++ language, not network programming. Have a look at
this groups welcome message http://www.slack.net/~shiva/welcome.txt which
has suggestions for other groups that might be more suitable for your
question.


OK reading your post again I see that your question actually has nothing to
do with networking. It was the subject line that through me (and Alf as well
I guess).

Here is one way to measure elapsed time in C++

#include <time.h>

time_t t0 = time(0);

// some lengthy operation
....

time_t t1 = time(0);
cout << "That took " << difftime(t1, t0) << " seconds\n";

john
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Alexandre Plennevaux | last post by:
hello ! I would like to measure the time a user needs to connect to my website. In other words, to perform a ping between my website and the user's computer. I'm scratching my head as to how...
7
by: Valiz | last post by:
Hi, I am updating system time with IRIG time source which sends irregular pulses as shown below 11000011111100111111111111111111....(1-IRIG present and 0-IRIG not present) I need to update...
14
by: Gotisch | last post by:
Hi, we are currently writing an mostly singlethreaded (game)server application in c#. But we are encountering problems with the Garbage Collector: After a certain time but also apparently...
7
by: sreehari | last post by:
Hi All, I have this problem, I have developed a Master - Slave kinda appliacation , were the slave is generally a device.when i broadcast a message from my application, the Device seems to...
6
by: Giulio Petrucci | last post by:
Hi there, I need to implement a sort of RTP/RTSP. Nothing impossible, just a "minimal" implementation Anyway I need to know something more about how could I create real-time connection using the...
1
by: Lady dyna | last post by:
Question:How much time is required by a machine to transfer a file of 6MB across the network with 60Kpbs? Now if file is broken into packets, each of a size is 1000 bytes then how much time is...
25
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for...
5
by: jaco.versfeld | last post by:
Hi There, I have a basic TCP client and TCP server in C++. The TCP client connects to the server, and after a setup phase starts to transmit a file to the TCP server using multiple packets...
21
by: puzzlecracker | last post by:
Problem: I send a lot of requests to the application (running on a different box, of course), and I receive back responses from the app . Below: socket corresponds to Socket socket=new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.