Overflow, does it matter?

If i want to print value once a second far to the future is this OK for it:

Light1 = analogRead(LDR1); 

if (TimeNow > PrintTime)
{
  Serial.println(Light1);
  PrintTime = (TimeNow + 1000);
}

TimeNow = millis();

There will be value overflow sometimes (in every 70 min or what was that)
but does it actually matter in this use ? Or is there easy "proper" way to print it with few lines ?

(PrintTime is also unsigned long, like millis() is)

A subtraction should always be used so the roll-over will have no effect. Here is a rather long posting on the subject:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1260223964/1

There will be value overflow sometimes (in every 70 min or what was that)

sp. "every 49 days"

is this OK for it:

No. Subtraction s safe. Addition is not.

if(TimeNow - PrintTime > 1000)
{
   // print...
   PrintTime = TimeNow;
}

There will be value overflow sometimes (in every 70 min or what was that)

millis() overflows in about 49 days. micros() overflows in about 70 minutes.

Of course it should be done by sutracting ! Thanks for fast replies !

little messed millis and micros too :roll_eyes: