>>>But Windows provides a function, GetSystemTimeAsFileTime(), that
>>>allows you to query the system time in 100 nanosecond intervals.
>>What you mean is that the function returns time with a theoretical
>>resolution of 100ns. However it would appear likely that the actual
>>times returned have a resolution of 10ms. [rearranged slightly]
>>Write a program that busy loop calls this function and saves the results
>>over say 1000 calls.
>I wrote a program that retrieved 10,000 unique values from the
>GetSystemTimeAsFileTime() function, then analyzed the delta between
>consecutive times. Out of 9,999 deltas, 9,974 of them were 10.144
>milliseconds.
Does anyone have code available to do this for Linux?
|
|
0
|
|
|
|
Reply
|
ryandrk
|
9/6/2003 12:54:49 PM |
|
Drk,
See the jitter.c program in the NTP software distribution. Please also
reprise recent messages to this group on this topic.
Dave
Drk Ryan wrote:
>
> >>>But Windows provides a function, GetSystemTimeAsFileTime(), that
> >>>allows you to query the system time in 100 nanosecond intervals.
>
> >>What you mean is that the function returns time with a theoretical
> >>resolution of 100ns. However it would appear likely that the actual
> >>times returned have a resolution of 10ms. [rearranged slightly]
> >>Write a program that busy loop calls this function and saves the results
> >>over say 1000 calls.
>
> >I wrote a program that retrieved 10,000 unique values from the
> >GetSystemTimeAsFileTime() function, then analyzed the delta between
> >consecutive times. Out of 9,999 deltas, 9,974 of them were 10.144
> >milliseconds.
>
> Does anyone have code available to do this for Linux?
|
|
0
|
|
|
|
Reply
|
David
|
9/6/2003 7:42:08 PM
|
|
ryandrk@hotmail.com (Drk Ryan) wrote in message news:<de98eac0.0309081038.363f4d33@posting.google.com>...
>
> Trying to use the jitter.c program I get:
>
>
> Compiling...
> jitter.c
> c:\ntp-4.1.1a\util\jitter.c(11) : fatal error C1083: Cannot open
> include file: 'sys/time.h': No such file or directory
> Error executing cl.exe.
>
> jitter.exe - 1 error(s), 0 warning(s)
>
> How do I fix this error? I can't understand the command lines for the
> Build Log in jitter.html
The compiler can't find the standard system header file time.h. Check
you operating system documentation to determine how to populate the
standard files required to compile C programs.
roy
--
The suespammers.org mail server is located in California. Please do
not send unsolicited bulk e-mail or unsolicited commercial e-mail to
my suespammers.org address or any of my other addresses. These are my
opinions, not necessarily my employer's.
|
|
0
|
|
|
|
Reply
|
roy
|
9/9/2003 12:04:13 AM
|
|
Drk,
Can't help you; the problem is system dependent. You will have to figure
out where that include file is.
Dave
Drk Ryan wrote:
>
> "David L. Mills" <mills@udel.edu> wrote in message news:<3F5A3890.D5E8F5AD@udel.edu>...
> > Drk,
> >
> > See the jitter.c program in the NTP software distribution. Please also
> > reprise recent messages to this group on this topic.
> >
> > Dave
> >
>
> Trying to use the jitter.c program I get:
>
> Compiling...
> jitter.c
> c:\ntp-4.1.1a\util\jitter.c(11) : fatal error C1083: Cannot open
> include file: 'sys/time.h': No such file or directory
> Error executing cl.exe.
>
> jitter.exe - 1 error(s), 0 warning(s)
>
> How do I fix this error? I can't understand the command lines for the
> Build Log in jitter.html
|
|
0
|
|
|
|
Reply
|
David
|
9/9/2003 2:57:56 AM
|
|
"David L. Mills" <mills@udel.edu> wrote in message news:<3F5D41B4.AF8D8D8B@udel.edu>...
> Drk,
>
> Can't help you; the problem is system dependent. You will have to figure
> out where that include file is.
>
> Dave
I think this is it:
C:\ntp-4.1.1a\ports\winnt\include\sys\time.h
However, including this path gives me an error saying that ntp_types.h
cannot be found.
|
|
0
|
|
|
|
Reply
|
ryandrk
|
9/9/2003 9:32:40 AM
|
|
ryandrk@hotmail.com (Drk Ryan) writes:
> >>>But Windows provides a function, GetSystemTimeAsFileTime(), that
> >>>allows you to query the system time in 100 nanosecond intervals.
>
> >>What you mean is that the function returns time with a theoretical
> >>resolution of 100ns. However it would appear likely that the actual
> >>times returned have a resolution of 10ms. [rearranged slightly]
> >>Write a program that busy loop calls this function and saves the results
> >>over say 1000 calls.
>
> >I wrote a program that retrieved 10,000 unique values from the
> >GetSystemTimeAsFileTime() function, then analyzed the delta between
> >consecutive times. Out of 9,999 deltas, 9,974 of them were 10.144
> >milliseconds.
>
> Does anyone have code available to do this for Linux?
Drk,
call gettimeofday() twice and subtract. If you won't believe in the
method, describe what you are expecting as result.
Regards,
Ulrich
P.S: If you are lazy:
ntpq> rl
status=06f4 leap_none, sync_ntp, 15 events, event_peer/strat_chg,
version="ntpd 4.1.1@1.786 Tue Feb 4 16:39:46 UTC 2003 (1)",
processor="i586", system="Linux2.4.19-4GB", leap=00, stratum=2,
precision=-18, rootdelay=44.226, rootdispersion=275.741, peer=23695,
refid=lanczos.maths.tcd.ie,
reftime=c30861df.02caab8a Tue, Sep 9 2003 16:27:43.010, poll=7,
clock=c308624c.95697f1f Tue, Sep 9 2003 16:29:32.583, state=4,
offset=23.011, frequency=-15.395, jitter=15.000, stability=25.487
Precision means 2^-18 seconds...
|
|
0
|
|
|
|
Reply
|
Ulrich
|
9/9/2003 2:30:21 PM
|
|
ryandrk@hotmail.com (Drk Ryan) writes:
> "David L. Mills" <mills@udel.edu> wrote in message news:<3F5A3890.D5E8F5AD@udel.edu>...
> > Drk,
> >
> > See the jitter.c program in the NTP software distribution. Please also
> > reprise recent messages to this group on this topic.
> >
> > Dave
> >
>
> Trying to use the jitter.c program I get:
>
>
> Compiling...
> jitter.c
> c:\ntp-4.1.1a\util\jitter.c(11) : fatal error C1083: Cannot open
> include file: 'sys/time.h': No such file or directory
> Error executing cl.exe.
QUOTING YOURSELF: ``Does anyone have code available to do this for
Linux?''
Does cl.exe run with Linux???
Ulrich
>
> jitter.exe - 1 error(s), 0 warning(s)
>
> How do I fix this error? I can't understand the command lines for the
> Build Log in jitter.html
|
|
0
|
|
|
|
Reply
|
Ulrich
|
9/9/2003 2:31:48 PM
|
|
Ulrich,
For whatever good or bad come come of it, the actual ntpd precision is
calculated by calling get_systime(), which reads the system clock with
the highest resolution syscall available. So, what ntpd calls precision
is actually the time to cycle through the kernel and read the clock, not
the inherent resolution of the clock counter, which can be much less
than the precision. For instance, a Sun Blade 1000 has a clock counter
resolution of a bit more than a nanosecond, but a precision of about 400
ns. But, the actual resolution when reading the Blade clock is rounded
up to the next nanosecond.
While the procedure reads the clock several times, it is a bit more
tricky than first apparent. Some kernels (nanokernel/microkernel at
least from here) require Lamport's happens-before relation be rigorously
defended, so if the clock counter is really gross, like old Sun 500
microseconds, and the clock is read several times during that clock
tick, the time advances by une unit (nano or micro) for each read.
Unless detected and avoided, this could mislead the results. Time is so
fickle and intricate.
Dave
Ulrich Windl wrote:
> Drk,
>
> call gettimeofday() twice and subtract. If you won't believe in the
> method, describe what you are expecting as result.
>
> Regards,
> Ulrich
>
> P.S: If you are lazy:
> ntpq> rl
> status=06f4 leap_none, sync_ntp, 15 events, event_peer/strat_chg,
> version="ntpd 4.1.1@1.786 Tue Feb 4 16:39:46 UTC 2003 (1)",
> processor="i586", system="Linux2.4.19-4GB", leap=00, stratum=2,
> precision=-18, rootdelay=44.226, rootdispersion=275.741, peer=23695,
> refid=lanczos.maths.tcd.ie,
> reftime=c30861df.02caab8a Tue, Sep 9 2003 16:27:43.010, poll=7,
> clock=c308624c.95697f1f Tue, Sep 9 2003 16:29:32.583, state=4,
> offset=23.011, frequency=-15.395, jitter=15.000, stability=25.487
>
> Precision means 2^-18 seconds...
|
|
0
|
|
|
|
Reply
|
David
|
9/10/2003 1:47:14 AM
|
|
"David L. Mills" <mills@udel.edu> writes:
> Ulrich,
>
> For whatever good or bad come come of it, the actual ntpd precision is
> calculated by calling get_systime(), which reads the system clock with
> the highest resolution syscall available. So, what ntpd calls precision
> is actually the time to cycle through the kernel and read the clock, not
> the inherent resolution of the clock counter, which can be much less
> than the precision. For instance, a Sun Blade 1000 has a clock counter
> resolution of a bit more than a nanosecond, but a precision of about 400
> ns. But, the actual resolution when reading the Blade clock is rounded
> up to the next nanosecond.
Dave,
for practical use: Does it make any difference? The only way to
observe the system clock is by making system calls. If you see just
nanoseconds or multiples of it, you may assume the clock has no better
resolution. Did I think wrong?
>
> While the procedure reads the clock several times, it is a bit more
> tricky than first apparent. Some kernels (nanokernel/microkernel at
> least from here) require Lamport's happens-before relation be rigorously
> defended, so if the clock counter is really gross, like old Sun 500
> microseconds, and the clock is read several times during that clock
> tick, the time advances by une unit (nano or micro) for each read.
For my hardware this has never been a problem, because you cannot
execute two system calls within the same nanosecond. Even for a
microsecond you need a really fast machine. Still, the
time-compression is only temporary, right? I mean the amount is
returned to the user but the system clock doesn't get that amount
added.
Regards,
Ulrich
> Unless detected and avoided, this could mislead the results. Time is so
> fickle and intricate.
>
> Dave
>
> Ulrich Windl wrote:
>
> > Drk,
> >
> > call gettimeofday() twice and subtract. If you won't believe in the
> > method, describe what you are expecting as result.
> >
> > Regards,
> > Ulrich
> >
> > P.S: If you are lazy:
> > ntpq> rl
> > status=06f4 leap_none, sync_ntp, 15 events, event_peer/strat_chg,
> > version="ntpd 4.1.1@1.786 Tue Feb 4 16:39:46 UTC 2003 (1)",
> > processor="i586", system="Linux2.4.19-4GB", leap=00, stratum=2,
> > precision=-18, rootdelay=44.226, rootdispersion=275.741, peer=23695,
> > refid=lanczos.maths.tcd.ie,
> > reftime=c30861df.02caab8a Tue, Sep 9 2003 16:27:43.010, poll=7,
> > clock=c308624c.95697f1f Tue, Sep 9 2003 16:29:32.583, state=4,
> > offset=23.011, frequency=-15.395, jitter=15.000, stability=25.487
> >
> > Precision means 2^-18 seconds...
|
|
0
|
|
|
|
Reply
|
Ulrich
|
9/10/2003 2:54:08 PM
|
|
Ulrich Windl <Ulrich.Windl@RZ.Uni-Regensburg.DE> wrote in message news:<m33cf4vgmn.fsf@pc5234.klinik.uni-regensburg.de>...
> "David L. Mills" <mills@udel.edu> writes:
>
> Dave,
>
> for practical use: Does it make any difference? The only way to
> observe the system clock is by making system calls. If you see just
> nanoseconds or multiples of it, you may assume the clock has no better
> resolution. Did I think wrong?
>
> >
> > While the procedure reads the clock several times, it is a bit more
> > tricky than first apparent. Some kernels (nanokernel/microkernel at
> > least from here) require Lamport's happens-before relation be rigorously
> > defended, so if the clock counter is really gross, like old Sun 500
> > microseconds, and the clock is read several times during that clock
> > tick, the time advances by une unit (nano or micro) for each read.
>
> For my hardware this has never been a problem, because you cannot
> execute two system calls within the same nanosecond. Even for a
> microsecond you need a really fast machine. Still, the
> time-compression is only temporary, right? I mean the amount is
> returned to the user but the system clock doesn't get that amount
> added.
>
> Regards,
> Ulrich
>
> > Unless detected and avoided, this could mislead the results. Time is so
> > fickle and intricate.
> >
> > Dave
> >
It's worse than that. The topic subject has no real meaning. You cannot
measure ACTUAL resolution. You can only estimate it with some error range.
Moreover the act of measuring interferes with what is being measured.
See Heisenberg's Uncertainty Principle for details. Things like standard
deviation are important here. Standard CPU clocks can also fluctuate in
their 'tick'. CPU manufacturers have to test that before they ship the
chip. That doesn't mean that they won't ship chips that wildly vary. There
was a recent discussion of this issue. Jeff Mogul, who has more information
that I do had responded to that discussion.
Danny
|
|
0
|
|
|
|
Reply
|
mayer
|
9/11/2003 9:46:52 PM
|
|
>"David L. Mills" <mills@udel.edu> wrote in message
>
> See the jitter.c program in the NTP software distribution.
How are the results of jitter.c interpreted?
What does Last rank refer to?
|
|
0
|
|
|
|
Reply
|
ryandrk
|
9/12/2003 6:26:59 PM
|
|
Drk,
That program is a hack and never intended as a teaching tool. Its
function is revealed in the source code. I did comment on the results in
an earlier message to this group. The results can be interpreted any way
you find useful for statistical analysis, algorithm design or just plain
curiousity.
Dave
Drk Ryan wrote:
>
> >"David L. Mills" <mills@udel.edu> wrote in message
> >
> > See the jitter.c program in the NTP software distribution.
>
> How are the results of jitter.c interpreted?
>
> What does Last rank refer to?
|
|
0
|
|
|
|
Reply
|
David
|
9/13/2003 4:58:39 PM
|
|
|
11 Replies
141 Views
(page loaded in 0.094 seconds)
Similiar Articles: High resolution timer. - comp.lang.asm.x86Linux 2.6 and clock frequency - comp.protocols.time.ntp Finally, I tried the high-res timers patch with and without dynamic ticks. ... program to test actual resolution of ... C++: PTHREAD_CANCEL_ASYNCHRONOUS and random crash - comp ...However, in the actual program where I need this ... However, when I run this test program, it crashes ... with g95 on the same machine (linux box), and the > program crashes ... Future Terminal Emulator? - comp.unix.solarisMove everything in his architecture to Linux ... When enlarging a window, I see the actual resolution ("800x800 ... Filtering Solutions, and terminal emulation software ... All Solutions Manuals & Test Banks Are HERE !!! - comp.unix ...... 6th Edition, Jean Andrews, Test Bank A+ Guide to Software ... Lembke, King, Jeffrey, Test Bank Advanced Guide to Linux ... 2005, Morris, Maisto, Test Bank Basic Real ... REAL Commodore Joystick and VICE under Windows - comp.emulators ...The VICE FAQ states that it's only possible under Linux. But someone must ... released under the GNU General Public License ... newly written test programs on real ... Delay in C on linux or OSS - comp.lang.c... usr/bin/c89 to run under OSS environment or linux ... elapsed processor time used by the current program, which on a multitasking system may differ considerably from real ... How come recv() can get more than getsockopt(SO_RCVBUF) size ...... value should be less than 87380, but when I test ... with non-blocking socket, and I let the tcp client program ... SO_RCVBUF) size? programming.itags.org: Unix & Linux ... when using the Matlab "unix" command I get a unix broken pipe ...... txt " is large > 50000 lines the bash script "test.sh ... All the values are the same for me (Linux w/ 2008b). ... I just wrote a C only program that performes the same ... Frame decoration problems? - comp.lang.java.guiI guess just for fun I should try it on a Linux machine too ... quoted or indirectly quoted someone who said : >My actual program uses pack() as well as the small test ... TCP/IP seq number gone, socket raw, C - comp.unix.programmer ...To test my C program i need a server and a client, so a wrote an ... Actually i don't know how > to get the real values ... Raw Sockets programming on Linux with C | Binary ... How to run a m file without opening matlab? - comp.soft-sys.matlab ...... program" without starting the whole matlab program. Is that possible? I have read that you can just type 'test' in linux ... just have it open those files ... model in real ... Random number in Fortran 90/95 - comp.lang.fortran... 1] I try this wrong code: PROGRAM ... RANDOM_005fSEED.html Under Linux, one ... the website suggested by Tobias): program test_random_number REAL ... using gfortran to call windows api functions - comp.lang.fortran ...But you do have a real problem in writing the ... end interface end module Win32 program test use ... fortran ... ... gfortran 4.4 and mex files on Linux ... How to early exit a script - comp.soft-sys.matlabI'm sure there must be a command to exit a program but ... I have a resolution problem which can cause a temperature ... dhclient from modifying resolv.conf - comp.os.linux ... Clearing filesystem cache. How? - comp.unix.programmerThis program reads various files and to get a measurement ... files and to get a measurement as close to the real ... regards -- NPV "Linux is to Lego as Windows is to ... Real-time data collection in Linux: A case studyREAL-TIME DATA COLLECTION IN LINUX 2 that program access to hardware I/O ... First, what is the actual timing resolution of ... data from 10 runs of the test program (a ... High Resolution Timers - eLinux.orgCurrently, timers in Linux are only supported at a resolution ... get_time: ktime_get_real ... If so, then the high resolution timer feature is active. Run a test program 7/24/2012 9:42:39 PM
|