Help with motor code

This is the code that I am using to run my stepper motors:

#include <Stepper.h>

const int stepsPerRev = 513; // steps per rev
const int speedRpm = 5; // speed rpm

Stepper stepper1(stepsPerRev, 10, 8, 9, 11);
Stepper stepper2(stepsPerRev, 6, 4, 5, 7);

void setup() {
// set speed

void loop() {
// step one revolution in one direction:

But when I run it one motor runs and then stops and then the other one goes and then stops and they only run one at a time. I know that this is because arduino runs its code line by line, but i need help making them run at the same time. Anything will help!

but i need help making them run at the same time.

You need to look at AccelStepper or MultiStepper, then. The Stepper library can only move one stepper at a time.

You can make them appear to move simultaneously:

void loop() {
  // step one revolution  in one direction:
  for (int i=0; i<stepsPerRev; i++) {
  for (int i=0; i<stepsPerRev; i++) {