How accurate is delay();

So,it would be better to get a real time clock...and can you guys give me example program that counts numbers every second 1...2...3...4 and prints it to serial,because I have no idea how to write that and I would like to test arduino as a RTC to see how bad it really is :smiley: