exiting the serial monitor resets the value of millis() ? [RESOLVED]

following code runs fine (in the serial monitor, displays time in seconds since sketch began running)

however, if I exit the serial monitor and then re-open it...it starts back at 0? the tx light on the board is still blinking every 1second.

unsigned long Ms;
unsigned long TimeInSeconds;

void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.print("Time: ");
  Ms = millis();
  TimeInSeconds = Ms / 1000;
  Serial.println(TimeInSeconds);
  delay(1000); //transmit the time every one second 
}

Exiting the serial monitor cases the comm port to be closed and the DTR signal to deactivate. This causes a auto-reset to the arduino board, which in turn starts the sketch from start where millis is initiated to 0.

Lefty

retrolefty:
Exiting the serial monitor cases the comm port to be closed and the DTR signal to deactivate. This causes a auto-reset to the arduino board, which in turn starts the sketch from start where millis is initiated to 0.

Lefty

solid answer, thanks!