I'm doing a project for a long count, but I have a problem ... How do I and that when a sensor is active time in millis () needs to stop.

The project consists in counting the time it takes for a part to get from one side of a carpet (Sensor 1) the other side (Sensor 2)

I hope my explanation has not been confused

millis() never needs to stop - just like a clock never stops. To measure a time interval save the value of millis() at the start and again at the end and subtract them.

Always save the value of miilis() into an unsigned long variable.