millis() resets every time I open the Serial Monitor

Opening the serial port (starting serial monitor) auto resets the Arduino. You can temporally disable the auto reset by putting a 10uf cap from reset to ground or, on some Arduinos, there is a jumper on the PCB that you can cut. You will need to re-enable the auto reset or manually reset the board to upload new code, though.