While applications may differ you'll likely still need some sort of calibration in software. Sorry to blow the fluffy duffy dream that you might see here: servos are notoriously inaccurate. Save the value of millis() immediately before you start the servo and then stop the servo when the later value of millis() is (say) 5000 (for 5 seconds) later than the saved value. An Arduino library for controlling continuous (full rotation) servos similar to stepper motors. Save the modified sketch and upload it to the Arduino. The usual way to do this is the technique in the Blink Without Delay sketch. This timing diagram shows how a Parallax continuous rotation servo turns full speed clockwise.
![continuous rotation servo motor arduino code continuous rotation servo motor arduino code](https://aws1.discourse-cdn.com/arduino/optimized/4X/c/8/9/c898ebd2773794d9c1a301f7ad82efc1b465b267_2_1332x1000.jpeg)
(I'm assuming its a continuous rotation servo).
![continuous rotation servo motor arduino code continuous rotation servo motor arduino code](https://s3-eu-west-1.amazonaws.com/catchit/2017/11/servo_thumb2.png)
I'm guessing that you want to use an external potentiometer to set the speed but you want separate control of how long the servo operates.