ds1302 // advancing

Please, I'm using a RTC module like this:
Arduino Playground - DS1302 with dódigo example below (also tested with others)
But time is always a second more ...

eg

Tuesday 2009-05-19 21:16:37
Tuesday 2009-05-19 21:16:39
Tuesday 2009-05-19 21:16:41
Tuesday 2009-05-19 21:16:43
Tuesday 2009-05-19 21:16:45
Tuesday 2009-05-19 21:16:47
Tuesday 2009-05-19 21:16:49
Tuesday 2009-05-19 21:16:51

Can anyone help me? Jáviram this?

thank you

Code:

/*
Example sketch for interfacing with the DS1302 timekeeping chip.

Copyright (c) 2009, Matt Sparks
All rights reserved.

http://quadpoint.org/projects/arduino-ds1302
*/
#include <stdio.h>
#include <string.h>
#include <DS1302.h>

/* Set the appropriate digital I/O pin connections */
uint8_t CE_PIN = 5;
uint8_t IO_PIN = 6;
uint8_t SCLK_PIN = 7;

/* Create buffers */
char buf[50];
char day[10];

/* Create a DS1302 object */
DS1302 rtc(CE_PIN, IO_PIN, SCLK_PIN);

void print_time()
{
/* Get the current time and date from the chip */
Time t = rtc.time();

/* Name the day of the week /
memset(day, 0, sizeof(day)); /
clear day buffer */
switch (t.day) {
case 1:
strcpy(day, "Sunday");
break;
case 2:
strcpy(day, "Monday");
break;
case 3:
strcpy(day, "Tuesday");
break;
case 4:
strcpy(day, "Wednesday");
break;
case 5:
strcpy(day, "Thursday");
break;
case 6:
strcpy(day, "Friday");
break;
case 7:
strcpy(day, "Saturday");
break;
}

/* Format the time and date and insert into the temporary buffer */
snprintf(buf, sizeof(buf), "%s %04d-%02d-%02d %02d:%02d:%02d",
day,
t.yr, t.mon, t.date,
t.hr, t.min, t.sec);

/* Print the formatted string to serial so we can see the time */
Serial.println(buf);
}

void setup()
{
Serial.begin(9600);

/* Initialize a new chip by turning off write protection and clearing the
clock halt flag. These methods needn't always be called. See the DS1302
datasheet for details. */
rtc.write_protect(false);
rtc.halt(false);

/* Make a new time object to set the date and time /
/
Tuesday, May 19, 2009 at 21:16:37. */
Time t(2009, 5, 19, 21, 16, 37, 3);

/* Set the time and date on the chip */
rtc.time(t);
}

/* Loop and print the time every second */
void loop()
{
print_time();
delay(1000);
}

It takes time to get the data from the clock. It takes time to format the string. It takes a fair amount of time, at 9600 baud, to send the data to the serial port. It takes time to call, and return from, the functions. You are not accounting for any of this time when you decide to sit on your thumbs for a whole second after doing all of the above. So, of course, you won't print once a second.

What you need to do is get the time as often as possible. When the current second value does not match the previous second value, format and send the string.