<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: clock_gettime resolution on openvms is 1 millisecond in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196421#M43989</link>
    <description>Eric,&lt;BR /&gt;&lt;BR /&gt;  I'm not sure what language or versions you're talking about, or where "clock_gettime" obtains its values.&lt;BR /&gt;&lt;BR /&gt;  I'm surprised you're even getting 1 msec. The software clock interrupt is usually 10 msec intervals on VAX and Alpha (though perhaps the granularity has been reduced on Integrity?)&lt;BR /&gt;&lt;BR /&gt;Remember your computer is not a chronometer. Keeping very accurate, fine granularity time is not conducive to high performance, especially on multi user systems! &lt;BR /&gt;&lt;BR /&gt; Usually the best you can do for fine grained timing is to use a cycle counter. On Alpha there were per process and per system cycle counters rpcc and rscc, accessed through special macros, depending on what language you're using. Unfortunately it's non-trivial to handle general time periods, as you need to deal with rollover of the 32 bit register.&lt;BR /&gt;&lt;BR /&gt;On IA64 there's a register called AR44 which is a 64 bit interval timer. You'll need to find your language specific mechanism for accessing it (but since it's 64 bit, it should be easier to manager than rpcc or rscc :-)</description>
    <pubDate>Tue, 13 May 2008 04:42:04 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2008-05-13T04:42:04Z</dc:date>
    <item>
      <title>clock_gettime resolution on openvms is 1 millisecond</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196420#M43988</link>
      <description>I am running OpenVMS on an HP Integrity box and referencing the system clock using clock_gettime&lt;BR /&gt;in order to measure my application latency, but it appears that the resolution I am getting from this call is 1 millisecond.  I ran a test loop and the minimum positive difference between to successive calls to clock_gettime was 1 millisecond.  There were more than 2 million calls to clock_gettime per second in the test loop.  Is there a system wide clock that I can reference in this environment with a microsecond resolution or better?</description>
      <pubDate>Tue, 13 May 2008 02:53:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196420#M43988</guid>
      <dc:creator>Eric Klingelberger</dc:creator>
      <dc:date>2008-05-13T02:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: clock_gettime resolution on openvms is 1 millisecond</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196421#M43989</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;  I'm not sure what language or versions you're talking about, or where "clock_gettime" obtains its values.&lt;BR /&gt;&lt;BR /&gt;  I'm surprised you're even getting 1 msec. The software clock interrupt is usually 10 msec intervals on VAX and Alpha (though perhaps the granularity has been reduced on Integrity?)&lt;BR /&gt;&lt;BR /&gt;Remember your computer is not a chronometer. Keeping very accurate, fine granularity time is not conducive to high performance, especially on multi user systems! &lt;BR /&gt;&lt;BR /&gt; Usually the best you can do for fine grained timing is to use a cycle counter. On Alpha there were per process and per system cycle counters rpcc and rscc, accessed through special macros, depending on what language you're using. Unfortunately it's non-trivial to handle general time periods, as you need to deal with rollover of the 32 bit register.&lt;BR /&gt;&lt;BR /&gt;On IA64 there's a register called AR44 which is a 64 bit interval timer. You'll need to find your language specific mechanism for accessing it (but since it's 64 bit, it should be easier to manager than rpcc or rscc :-)</description>
      <pubDate>Tue, 13 May 2008 04:42:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196421#M43989</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-05-13T04:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: clock_gettime resolution on openvms is 1 millisecond</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196422#M43990</link>
      <description>&amp;gt; I'm not sure [...]&lt;BR /&gt;&lt;BR /&gt;HELP CRTL CLOCK_GETTIME&lt;BR /&gt;&lt;BR /&gt;Interestingly, clock_getres() reports 100ns&lt;BR /&gt;resolution, and a clock_gettime() value seems&lt;BR /&gt;to look as if that were true, but getting a&lt;BR /&gt;change smaller than 1ms seems to be&lt;BR /&gt;difficult (Alpha (XP1000), VMS V7.3-2, and&lt;BR /&gt;IA64 (zx2000) VMS V8.3-1H1).  Although on&lt;BR /&gt;the Alpha, I can get values which change&lt;BR /&gt;from, say, X.468064200 to X.469040700 to&lt;BR /&gt;X.470017200, while on the IA64, the lower&lt;BR /&gt;digits seem to come up the same always.&lt;BR /&gt;&lt;BR /&gt;It's a mystery.</description>
      <pubDate>Tue, 13 May 2008 05:03:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196422#M43990</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-05-13T05:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: clock_gettime resolution on openvms is 1 millisecond</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196423#M43991</link>
      <description>re: Steven,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Interestingly, clock_getres() reports &lt;BR /&gt;&amp;gt;100ns resolution, &lt;BR /&gt;&lt;BR /&gt;The OpenVMS software clock keeps time as a signed 64 bit integer counting 100ns intervals since 17-NOV-1858 00:00:00.00&lt;BR /&gt;&lt;BR /&gt;Positive values represent absolute times, negative values represent delta times.&lt;BR /&gt;&lt;BR /&gt;The system time is stored in EXE$GQ_SYSTIME. So, maybe clock_gettime returns that value converted into the appropriate C data type? &lt;BR /&gt;&lt;BR /&gt;Although the resolution is indeed 100ns, the clock is only updated every 10ms (although from Eric's observation, perhaps that's been reduced to 1ms on IA64?). The gory details are in the Internals and Data Structures Manual. There's a chapter called "Scheduling and Time Support"&lt;BR /&gt;&lt;BR /&gt;&amp;gt;the lower digits seem to come up the &lt;BR /&gt;&amp;gt;same always.&lt;BR /&gt;&lt;BR /&gt;  That depends on the radix you're using to display the value, and the tick increment expressed in that radix. The tick increment can vary if you're using a time synchronization mechanism, so you may see a long run of values with the low bits invariant, then a change resulting from a clock speed adjustement.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 May 2008 06:34:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196423#M43991</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-05-13T06:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: clock_gettime resolution on openvms is 1 millisecond</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196424#M43992</link>
      <description>On Itanium (HP rx3600) EXE$GL_TICKLENGTH = 10000 (2710 hex), meaning its clock gets incremented that many 100nS units per tick.  That works out to be 1 tick per ms.&lt;BR /&gt;&lt;BR /&gt;On VAX EXE$GL_TICKLENGTH = 100000 (186A0 hex) meaning it increments 100000 100 nanosecond units per tick.  In other words, the clock ticks once per 10 ms.&lt;BR /&gt;&lt;BR /&gt;Alpha (DS10L) is odd.  EXE$GL_TICKLENGTH bounces back and forth between 2625 hex and 2626 hex.  (9765 and 9766 decimal).  That's because its HW clock ticks 1024 times per second, and 1/1024 sec is not an even multiple of 100 ns, so apparently the tick length constantly changes.&lt;BR /&gt;&lt;BR /&gt;This might be platform-dependent (although I think all VAXes have 10ms ticks)</description>
      <pubDate>Fri, 16 May 2008 01:19:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/clock-gettime-resolution-on-openvms-is-1-millisecond/m-p/4196424#M43992</guid>
      <dc:creator>Michael Moroney</dc:creator>
      <dc:date>2008-05-16T01:19:35Z</dc:date>
    </item>
  </channel>
</rss>

