compare wall clock time between two machines 
Author Message
 compare wall clock time between two machines

I need to compare wall time between two Windows computers.  The two
are connected via WLAN, and one is meant to act as w32time-server for
the other.  Under normal circumstances this works fine, since the two
machines are the only computers on the WLAN, and time synch is
reasonably well.

I need to find out when things are not working fine and the time
synchronization between the two gets bad (I know about NTP, but let's
just assume we have to use w32time for now).

I have a socket connection open and can send commands between the two.
First attempt is to use 'clock seconds' and compare between local and
remote, assuming the network overhead is not too bad.  But I need a
bit more than 1 second resolution, i.e. I want to warn the user if
delta-t gets say > 50ms.

Looking at the TCL sources, "clock clicks -milliseconds" seems a
possible solution, since this just resembles what I would have coded
manually (call gettimeofday(), then add up, or construct some floating
point number).  But since the docs say "use clock clicks only for
relative time measurements", I wonder whether this means "only in the
same program", "only on the same computer", or "only with another TCL
clock".

The complete idea is to assume symmetric network delay, and subtract
1/2 the delay from the remote time, then compare with the local time.

  set start [clock clicks -milliseconds]
  set remote [get_remote_clock_clicks]
  set end [clock clicks -milliseconds]
  set delay [expr {$end-$start}]
  set delta_t [expr {abs(($remote-$delay/2.0)-$start)}]
  puts "time difference is $delta_t ms"

Any comments?  Better ideas?

R'



Mon, 22 Sep 2008 02:20:02 GMT  
 compare wall clock time between two machines
I solved something like this for me by
reading [clock seconds] in a while loop
and taking [clock clicks] or [clock milliseconds]
at the "boundary" i.e. if ($seconds != $lastseconds)

for  reasonable amounts of time passed you now
have a relationship between [clock seconds] and
[clock clicks] or [clock milliseconds]

the job then would be to keep track of delay and variance.

if your measurements leave the expected envelope
your clocks are either drifting apart or your
connection is getting unreliable.

uwe



Mon, 22 Sep 2008 05:39:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Wall clock time routine

2. Wall Clock Time

3. Seeking routine to return elapsed wall-clock time

4. Sharing clock time of two PC's.

5. Two images at the same time on one machine under NT

6. how to compare two columns in two files?

7. Comparing system time and log file time

8. optimum value of cpu time/clock time.

9. reading two files and comparing them

10. comparing two files

11. Comparing two databases.

12. Comparing fields in a two records

 

 
Powered by phpBB® Forum Software