a flag can not function

You mean the code "millis()" count the time when the code is running?

It counts the time since the Arduino was reset.

can you give me an example which displays a relative time?

Serial.print(millis());