Adafruit motorshield

I have written a code speeds up one motor and then a second motor but I would really like them to do this simultaneously as opposed to one after another. What would be the best method to accomplish this?

#include <Adafruit_MotorShield.h>
#include <Wire.h>

Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
Adafruit_DCMotor *myMotor2 = AFMS.getMotor(3);
void setup() 
{
AFMS.begin(); 
myMotor->setSpeed(150);
myMotor->run(FORWARD);
myMotor->run(RELEASE);
myMotor2->setSpeed(150);
myMotor2->run(FORWARD);
myMotor2->run(RELEASE);
}

void loop() 
{
 uint8_t i;
 
myMotor->run(FORWARD); 
for (i=0; i<255; i++) 
{
 myMotor->setSpeed(i);
 delay(10);
}
for (i=255; i!=0; i--)
{
 myMotor->setSpeed(i);
 myMotor->setSpeed(i);
 delay(10);
}
uint8_t h;
myMotor2->run(BACKWARD);
for (h=0; h<255; h++)
{
 myMotor2->setSpeed(h);
 delay(10);
}
for (h=255; h!=0; h--)
{
 myMotor2->setSpeed(h);
 delay(10);
}
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

I might try something like this:

if(millis() - oldSpeedTime >= motorSpeedIncreaseInterval) {
 motor1speed++;
 motor2speed++;
 
  if(motor1speed > 255)motor1speed = 0;
  if(motor2speed > 255)motor2speed = 0;
}

myMotor1->setSpeed(motor1speed);
myMotor2->setSpeed(motor2speed);

basic idea is:

get rid of delay() functions
set speed and direction for both motors using a variable to store the values
after variable have been set, make the changes to the motors.

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
Adafruit_DCMotor *myMotor2 = AFMS.getMotor(3);

You know this looks pretty silly, right?

Using names that make sense makes for MUCH easier coding. Something like leftMotor and rightMotor, perhaps. Or panMotor and tiltMotor. Whatever is appropriate for how the motors are used.

myMotor and myOtherMotor (or myMotor2) are not appropriate in ANY context.