Agreed. Even if you, say, used an Arduino with an external crystal for triggering interrupts you will have trouble hitting the exact timing. That is, unless you spend quite a lot on a very precise, temperature controlled and calibrated timing source.

If you want really precise, reproducable timing, you probably have to put your time critical stuff in an FPGA (or even better: ASIC) and hook that up to a very, very precise timing source, both for chip clock cycles and the external triggering interrupt. There are chip scale atomic clocks and things like that available for that purpose.

To make the data logging even more time stable, you also need to make sure your time critical code path is always the same, otherwise you introduce clock cycle count jitter. That means no conditionals from the start of the interrupt to having gathered all time critical data values in memory.

...basically, the more precision you want, the more specialized engineering you have to do. This can get expensive really, really fast. And there will always be compromises involved. It's the old mantra of "good/fast/cheap - pick any two of those".

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

In reply to Re^2: The most precise second (timer) by cavac
in thread The most precise second (timer) by tukusejssirs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.