arduino serial timer (noob needs help)

I am writing a code that suppose to count 5 minutes and then get back to 0 on the serial, I wrote a code that counts the time correctly until the first second and then the timer goes crazy and counts the time to fast
that is my code thank you for helping

int sec=0;
int periodStartMillis=0;
int mint=0;
void setup() {
 Serial.begin(9600);

}

void loop() {
  periodStartMillis = millis();
if (periodStartMillis >= 1000) {
  sec= sec +1;
  periodStartMillis = periodStartMillis -1000 ; 
}

if (sec == 60){
  mint = mint+1;
  sec = sec -60;
}
if (mint == 5){
  mint = mint -5 ;
}
Serial.println("periodStartMillis");
Serial.println (periodStartMillis);
Serial.println ("sec");
Serial.println (sec);
Serial.println ("mint");
Serial.println (mint);
}

How to use millis() for timing.

The demo Several Things at a Time illustrates the use of millis() to manage timing. It may help with understanding the technique.

...R