Control PWM motor running time with millis

Pefi:
So moving it up in the enclosed loop where i decide the pump to run would be more suitable?

If you renamed the variable to pumpStartTime it would be more obvious where in the code you should set its value