Correcting Frequency error for time keeping

It can't be any more precise than the oscillator itself. I just turned on my Uno about 10 minutes ago. Here's how much the resonator varied in that short time:

15983237 Hz, -1048 ppm
15982648 Hz, -1085 ppm

That's a difference that would equal about 3 seconds per day. Over the course of a typical day (indoors) the frequency might vary by around 150ppm, about 13 sec/day. Now maybe that's good enough or maybe it's not. It depends.

A crystal is a huge improvement. In the same 10 minutes a crystal I was measuring didn't vary at all (to a resolution of 1 ppm). In a typical day it might only change by 2-3 ppm.

However editing wiring.c presents a different problem. Unless you have only one processor that you compile for you will have to edit this core file to change it whenever you compile for a different one. It would be better to have some sort of callback function or... I don't know. Something you could do at the sketch level.

edit: Maybe this is an appropriate situation for using the method described in post #7 of this thread.