Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Calculating time required to recieve packets...

Reply
Thread Tools

Calculating time required to recieve packets...

 
 
Adam Balgach
Guest
Posts: n/a
 
      09-28-2004
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.
 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      09-28-2004
* 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?
 
Reply With Quote
 
 
 
 
Adam Balgach
Guest
Posts: n/a
 
      09-28-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Alf P. Steinbach) wrote in message news:<(E-Mail Removed)>...
> * Adam Balgach:
> >

>
> OT



what does that mean?
 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      09-28-2004

"Adam Balgach" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> (E-Mail Removed) (Alf P. Steinbach) wrote in message
> news:<(E-Mail Removed)>...
>> * 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


 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      09-28-2004
>>>
>>> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista: "Calculating time remaining" takes long time on any fileaction. Even with all suggested KB patches installed Peter Computer Support 2 12-15-2007 12:57 AM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
Calculating average time GregM Python 3 07-08-2005 09:12 AM
Calculating time of employee session from the log date/time stampusing perl Jayesh Kamdar Perl Misc 2 05-25-2005 12:08 AM
An XML question - calculating time total T-Narg XML 3 03-03-2005 02:41 AM



Advertisments