There is always a difference between microcontroller generated time and the original time no matter how precise you can go for the same; small or tiny delays can add upto several seconds of delays when clubbed together. Maybe this is one of the reasons why RTCs (Real Time Clock) have been developed for such applications.