How to find currnet time in Microseconds?
Author Message
How to find currnet time in Microseconds?

Hi,
I would like to know how I can find the current time in microseconds.

I need to find transmission delay for data transfer between two
machines. I'm using the gettimeofday() to get the time difference. But
problem is that it is given a value of the order of 10^78.

I would thus not be able to calculate the time differnce between the two
values used by two programs on two different machines.

Knidly suggest me a method of finding current time of day in
microseconds.

Fasahat

Mon, 13 Nov 2000 03:00:00 GMT
How to find currnet time in Microseconds?

Quote:
>Hi,
>I would like to know how I can find the current time in microseconds.

There is no portable way to do this and on many platforms no way to
do it at all (assuming you want microsecond resolution). If you didn't
want that you could always take a time in seconds and multiply it by
a million.

Quote:
>I need to find transmission delay for data transfer between two
>machines. I'm using the gettimeofday() to get the time difference. But
>problem is that it is given a value of the order of 10^78.

The comp.lang.c answer is that the language has no gettimeofday() function.
This is nest asked in a Unix related newsgroup such as comp.unix.programmer.
If it is giving strange results then you are most likely not using it
correctly. However it would be difficult to diagnose that without seeing
your code. 10^78 suggests that you've managed to do some sort of floating
point conversion which is suspect. Check carefully how you are displaying
the results. If you are using *printf() check that you have used the
correct conversion specifier.

--
-----------------------------------------

-----------------------------------------

Tue, 14 Nov 2000 03:00:00 GMT
How to find currnet time in Microseconds?

The way I would do it would be to put NTP on both systems, wait a week while they get nice and
synchronized, and then run your tests.

--
J. Buck Caldwell

Engineer - Technical Support - Webmaster

PO Box 8470            http://www.polygon.com/     fax: (314) 997-9696
St. Louis, MO 63132     ftp://ftp.polygon.com/     bbs: (314) 997-9682

Sun, 19 Nov 2000 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages