Actually there is a way of running the motor using rotations without waiting for time, called waitForCompletion. Simply adding a “, false” to the end of a rotateFor command tells the Brain to not wait for the completion of the action and to start running the next action.
For example:
left.spinFor(directionType::fwd, 1, rotationUnits::rev, 100, velocityUnits::pct);
right.spinFor(directionType::fwd, 1, rotationUnits::rev, 100, velocityUnits::pct);
waits for the left motor to complete the action before starting the right motor action.
But adding a false to the end of left tells the Brain to start running the next command:
left.spinFor(directionType::fwd, 1, rotationUnits::rev, 100, velocityUnits::pct, false);
right.spinFor(directionType::fwd, 1, rotationUnits::rev, 100, velocityUnits::pct);
And in this case, the right motor starts spinning. This means that both will motors will run simultaneously for the same amount of time since they are moving the same amount of rotations.
Alternatively you could use a motor group or drive train and complete these actions easier. You can set up a drive train and motor group like this:
//motor definitions:
vex::motor RightRearMotor (vex::PORT9, vex::gearSetting::ratio18_1,true);
vex::motor RightFrontMotor (vex::PORT10, vex::gearSetting::ratio18_1,true);
vex::motor LeftFrontMotor (vex::PORT1, vex::gearSetting::ratio18_1,false);
vex::motor LeftRearMotor (vex::PORT2, vex::gearSetting::ratio18_1,false);
//4 motor base motor group:
vex::motor_group d(LeftFrontMotor, LeftRearMotor, RightFrontMotor, RightRearMotor);
//4 motor base drivetrain:
vex::motor_group l(LeftFrontMotor, LeftRearMotor);
vex::motor_group r(RightFrontMotor, RightRearMotor);
vex::drivetrain dt(l, r);