Lift Mechanism - Victor Coding

So 90% of the code for my robot is finished but I’ve ran into a specific issue. The lift mechanism is run by two victors which need to be coded to run for a certain amount of time, however I am unsure of how to setup a timer for the victor to run for, anyone know how?

Is there a reason you are wanting to run for a period of time instead of until a limit switch is hit? This would allow you to stop the mechanism based on where it is instead of how long it runs.

This will help you if you are running the lift (in either direction) and then the robot is disabled (end of match/e-stop) and you need to move the mechanism to one of the end points (other points can be added as well) from wherever it stopped. If you run it up or down based on time it will move past the desired end point.

Performing a timed task depends a lot on which framework you are using for your Robot code and whether you are doing it in an autonomous state where nothing else needs to be done or a teleop state where other things need to be happening at the same time.

Are you using the Command based framework, the Iterative based framework or the Sample (simple) framework?

Can you post some of your source code (showing how your victors are constructed and where you want to activate them)? It would help in making suggestions.