user202: I'm currently trying to create an Arduino time clock by using the PJRC Time library (http://www.pjrc.com/teensy/td_libs_Time.html). I know that since most of the Arduino boards are running with a 16MHz clock and a single resonator, the time can become "out-of-sync" after a certain period of time. 
However, I was wondering if anyone has an idea about the accuracy of the Time library when used on the Arduino DUE with a 84MHz clock. I've been testing it out and so far, the clock has been kept in sync for a few hours. Thanks!

user83: Your average system clock crystal will be off by several tens ppm (parts per million. They are great for stable and accurate timing of signals, but dramatic for keeping accurate time. Without special provisions the system crystal may be off by several seconds per day.
The solution is to use a proper Real Time Clock, driven by what is commonly known as a 32768Hz watch crystal. These crystals are easily a factor 10 better in accuracy. You can either set up your own oscillator that interrupts the main processor and keep count in your Arduino sketch or you find a RTC breakout board.
Two random examples that pop up in Google with search terms "RTC breakout":

http://www.cutedigi.com/breakout-board/ds1302-rtc-breakout.html
https://www.sparkfun.com/products/10160


user84: The best way to know the accuracy of the resonator of your board is to measure it yourself.
To do so, you can use the Arduino millis() function of your board and write a small sketch that will:

enable you to set the beginning time for measuring time drift (eg with a simple push button); you will trigger the button based on an accurate time base.
then repeatedly call millis() until at least 120h ("arduino hours", that would be around 5 days) have elapsed
display a signal when those 120h have elapsed (your sketch should probably "warn" you before the exact time has been reached so you get ready for measure)
when the 120h have elapsed, check your reference time based (used in step 1.) and check how much time have elapsed (should be 120h +/- epsilon)
once you know the drift of your clock, and provided your board will run in the same environental conditions (temperature mainly) of your measure, you can use it in your sketches to adjust the millis() value every hour or so.

Of course, this approach is far from perfect as it requires human intervention and thus will create additional time drifts during measurements, that's why you need to measure your clock time drifts over a long period.
An improved approach would be to connect a high accuracy RTC clock (the accuracy must be chosen based on the accuracy you need for your application) to your board and adapt the sketch so that it automatically calculates the drift. Once you got the time drift you can do the same as step 5 above in your sketches, and disconnect the RTC clock from your board.
Important points:

measure the time drift on the board that will need clock adjustment later on (if you have several boards, you must measure one drift per board)
ensure the stability of the environment in which your board will be used

Finally, if you really need high accuracy, then definitely connect an external clock source (e.g. RTC clock, GPS, NTP) to your board and use it as a SyncProvider for the PJRC library.

user7508: Re-visiting an old question... as I found a very informative blog post
that sheds new light into it. But let me first provide some context
before giving the link.
When assessing the quality of a time base, be it a crystal, a ceramic
resonator or a lab-grade frequency standard, there are two notions that
should be distinguished:

accuracy: how close is the frequency of the time base to its
nominal value
stability: how much does that frequency drift over time

Accuracy is important if you want your clock to give correct time “out
of the box”. However, if you are willing to spend some time calibrating
your clock, then you do not really care because you are going to
calibrate out any inaccuracy you measure. jfpoilpret's answer provides
an example of a “manual” calibration protocol, which is by necessity
quite lengthy. If you can borrow a GPS module with a 1PPS output, the
calibration could be done in a few seconds.
Stability is a more serious issue. If the frequency of the time base
drifts randomly, this will defeat your calibration efforts. Essentially,
the calibration will tell you how fast or slow your clock is running
right now, but it will not allow you to predict how fast or slow it
will run in the future.
Here is the promised link: Arduino clock frequency
accuracy, by Joris van Rantwijk.
What Joris did is measure the accuracy and stability of an Arduino Pro
Mini (clocked off a ceramic resonator) and an old Duemilianove (quartz
crystal). From my perspective, the main takeaways are:

both clocks are grossly inaccurate, thus both would need user
calibration in order to be used as timepieces
the quartz crystal of the Duemilianove has decent stability, better
than 1.5e-8 at 6 h averaging time
the stability of the Pro Mini’s ceramic resonator is pathetic, more
than two orders of magnitude worse than the crystal, which makes it
essentially useless as a time piece

Here is his Allan deviation plot, which measures clock instability
as a function of observation time:

(source: jorisvr.nl) 
Although this study has some limitations (only two boards were tested,
and the observation time is too short), it is well thought and very
informative. I encourage you to read it in whole.

user10: The limitations of accuracy of the library depend on accuracy of the crystal. When they make, or cook, the crystal they can only make it to a certain degree accurate, also the environment of the crystal (temperature, humidity, etc.) play a role in the accuracy of it. Let's say you have a crystal that is off by .5 second every hour, great for short term, but if you expand that over a year it is over 1 hour off by that time. If you want something to keep an accurate time over a long period I suggest a real time clock (they still have inaccuracies), a GPS module, or an internet connect to sync with.
For further information look at the wikipedia article on quartz crystals
The use of a 84MHz crystal versus a 16MHz crystal will not necessarily improve the accuracy of the Arduino clock since the frequency of the crystal is more an indicator of processor speed than accuracy. The accuracy of the Arduino clock is primarily dependent on the accuracy of the crystal oscillator.
EDIT: I am no expert on crystal oscillators so if you see anything wrong here please let me know

202: <p>I'm currently trying to create an Arduino time clock by using the PJRC Time library (<a href="http://www.pjrc.com/teensy/td_libs_Time.html">http://www.pjrc.com/teensy/td_libs_Time.html</a>). I know that since most of the Arduino boards are running with a 16MHz clock and a single resonator, the time can become "out-of-sync" after a certain period of time. </p>

<p>However, I was wondering if anyone has an idea about the accuracy of the Time library when used on the Arduino DUE with a 84MHz clock. I've been testing it out and so far, the clock has been kept in sync for a few hours. Thanks!</p>
 83: <p>Your average system clock crystal will be off by several tens ppm (parts per million. They are great for stable and accurate timing of signals, but dramatic for keeping accurate time. Without special provisions the system crystal may be off by several seconds per day.</p>

<p>The solution is to use a proper Real Time Clock, driven by what is commonly known as a 32768Hz watch crystal. These crystals are easily a factor 10 better in accuracy. You can either set up your own oscillator that interrupts the main processor and keep count in your Arduino sketch or you find a RTC breakout board.</p>

<p>Two random examples that pop up in Google with search terms "RTC breakout":</p>

<ul>
<li><a href="http://www.cutedigi.com/breakout-board/ds1302-rtc-breakout.html" rel="nofollow">http://www.cutedigi.com/breakout-board/ds1302-rtc-breakout.html</a></li>
<li><a href="https://www.sparkfun.com/products/10160" rel="nofollow">https://www.sparkfun.com/products/10160</a></li>
</ul>
 84: <p>The best way to know the accuracy of the resonator of your board is to measure it yourself.</p>

<p>To do so, you can use the Arduino <code>millis()</code> function of your board and write a small sketch that will:</p>

<ol>
<li>enable you to set the beginning time for measuring time drift (eg with a simple push button); you will trigger the button based on an <strong>accurate</strong> time base.</li>
<li>then repeatedly call millis() until at least 120h ("arduino hours", that would be around 5 days) have elapsed</li>
<li>display a signal when those 120h have elapsed (your sketch should probably "warn" you before the exact time has been reached so you get ready for measure)</li>
<li>when the 120h have elapsed, check your reference time based (used in step 1.) and check how much time have elapsed (should be 120h +/- epsilon)</li>
<li>once you know the drift of your clock, and provided your board will run in the same environental conditions (temperature mainly) of your measure, you can use it in your sketches to adjust the <code>millis()</code> value every hour or so.</li>
</ol>

<p>Of course, this approach is <strong>far from perfect</strong> as it requires <strong>human intervention</strong> and thus will create additional time drifts during measurements, that's why you need to measure your clock time drifts over a long period.</p>

<p>An improved approach would be to connect a high accuracy RTC clock (the accuracy must be chosen based on the accuracy you need for your application) to your board and adapt the sketch so that it automatically calculates the drift. Once you got the time drift you can do the same as step 5 above in your sketches, and disconnect the RTC clock from your board.</p>

<p><strong>Important points</strong>:</p>

<ul>
<li>measure the time drift on the board that will need clock adjustment later on (if you have several boards, you must measure one drift per board)</li>
<li>ensure the stability of the environment in which your board will be used</li>
</ul>

<p>Finally, if you really need high accuracy, then definitely connect an external clock source (e.g. RTC clock, GPS, NTP) to your board and use it as a SyncProvider for the PJRC library.</p>
 7508: <p>Re-visiting an old question... as I found a very informative blog post
that sheds new light into it. But let me first provide some context
before giving the link.</p>

<p>When assessing the quality of a time base, be it a crystal, a ceramic
resonator or a lab-grade frequency standard, there are two notions that
should be distinguished:</p>

<ul>
<li><strong>accuracy</strong>: how close is the frequency of the time base to its
<em>nominal</em> value</li>
<li><strong>stability</strong>: how much does that frequency drift over time</li>
</ul>

<p>Accuracy is important if you want your clock to give correct time “out
of the box”. However, if you are willing to spend some time calibrating
your clock, then you do not really care because you are going to
calibrate out any inaccuracy you measure. jfpoilpret's answer provides
an example of a “manual” calibration protocol, which is by necessity
quite lengthy. If you can borrow a GPS module with a 1PPS output, the
calibration could be done in a few seconds.</p>

<p>Stability is a more serious issue. If the frequency of the time base
drifts randomly, this will defeat your calibration efforts. Essentially,
the calibration will tell you how fast or slow your clock is running
<em>right now</em>, but it will not allow you to predict how fast or slow it
will run <em>in the future</em>.</p>

<p>Here is the promised link: <a href="http://jorisvr.nl/article/arduino-frequency" rel="nofollow noreferrer">Arduino clock frequency
accuracy</a>, by Joris van Rantwijk.</p>

<p>What Joris did is measure the accuracy and stability of an Arduino Pro
Mini (clocked off a ceramic resonator) and an old Duemilianove (quartz
crystal). From my perspective, the main takeaways are:</p>

<ul>
<li>both clocks are <em>grossly</em> inaccurate, thus both would need user
calibration in order to be used as timepieces</li>
<li>the quartz crystal of the Duemilianove has decent stability, better
than 1.5e-8 at 6 h averaging time</li>
<li>the stability of the Pro Mini’s ceramic resonator is pathetic, more
than <em>two orders of magnitude</em> worse than the crystal, which makes it
essentially useless as a time piece</li>
</ul>

<p>Here is his <a href="https://en.wikipedia.org/wiki/Allan_variance" rel="nofollow noreferrer">Allan deviation</a> plot, which measures clock instability
as a function of observation time:</p>

<p><a href="https://i.stack.imgur.com/Cy5Le.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cy5Le.png" alt="Allan deviation of Arduino Clock Frequency"></a><br>
<sub>(source: <a href="http://jorisvr.nl/images/arduinofreq/allandev_small.png" rel="nofollow noreferrer">jorisvr.nl</a>)</sub>  </p>

<p>Although this study has some limitations (only two boards were tested,
and the observation time is too short), it is well thought and very
informative. I encourage you to read it in whole.</p>
 10: <p>The limitations of accuracy of the library depend on accuracy of the crystal. When they make, or cook, the crystal they can only make it to a certain degree accurate, also the environment of the crystal (temperature, humidity, etc.) play a role in the accuracy of it. Let's say you have a crystal that is off by .5 second every hour, great for short term, but if you expand that over a year it is over 1 hour off by that time. If you want something to keep an accurate time over a long period I suggest a real time clock (they still have inaccuracies), a GPS module, or an internet connect to sync with.</p>

<p>For further information look at the <a href="https://en.wikipedia.org/wiki/Quartz_clock">wikipedia article on quartz crystals</a></p>

<p>The use of a 84MHz crystal versus a 16MHz crystal will not necessarily improve the accuracy of the Arduino clock since the frequency of the crystal is more an indicator of processor speed than accuracy. The accuracy of the Arduino clock is primarily dependent on the accuracy of the crystal oscillator.</p>

<p>EDIT: I am no expert on crystal oscillators so if you see anything wrong here please let me know</p>
