4 digit 7 segment displau

I am working on code to run a dc motor with a button and have the time the button was pressed to be displayed on a 4 digit 7 segment display. I am using a 74HC595 shift register to help cut down on pins running the display. Immediately after upload the display shows 2222. I have printed the timeElapsed to the serial monitor and noticed the hundredths place disappears once timeElapsed gets to 10 and the tenths place disappears once timeElapsed gets to 20. Please help me get the timeElapsed to show up on the display. Here is my code

const int buttonPin= 2;
int motorPin = 3;
int speed=200 ;
int buttonState;
int timeElapsed;
int timeElapsedS;


// shift register pins
const int latchPin = 5;  //74HC595  pin 9 STCP
const int clockPin = 6;  //74HC595  pin 10 SHCP
const int dataPin  = 4;  //74HC595  pin 8 DS

// multi-segment digit select pins
const int digit1Pin = 9;    // Segment pin 12
const int digit2Pin = 10;   // segment pin 10
const int digit3Pin = 11;   // segment pin 8
const int digit4Pin = 12;   // segment pin 6 

int displayValue;
int readByte;

byte seven_seg_digits[16] = { B11111100,  // = 0
                             B01100000,  // = 1
                             B11011010,  // = 2
                             B11110010,  // = 3
                             B01100110,  // = 4
                             B10110110,  // = 5
                             B10111110,  // = 6
                             B11100000,  // = 7
                             B11111110,  // = 8
                             B11100110,  // = 9
                             B11101110,  // = A
                             B00111110,  // = b
                             B10011100,  // = C
                             B01111010,  // = d
                             B10011110,  // = E
                             B10001111  // = F
                            };

void setup() {
 pinMode(latchPin, OUTPUT);
 pinMode(clockPin, OUTPUT);
 pinMode(dataPin, OUTPUT);
 pinMode(digit1Pin, OUTPUT);
 pinMode(digit2Pin, OUTPUT);
 pinMode(digit3Pin, OUTPUT);
 pinMode(digit4Pin, OUTPUT);

 pinMode(motorPin, OUTPUT);
 pinMode(buttonPin, INPUT);

    // initial display value
  Serial.begin(9600);
  }
void displayDigit(int digitNumber,int number)
{
 

 if (digitNumber == 4)
 {
 digitalWrite(digit1Pin, LOW); // set the pin low so data can be sent
 digitalWrite(latchPin, LOW);
 shiftOut(dataPin, clockPin, LSBFIRST, seven_seg_digits[number]);
 digitalWrite(latchPin, HIGH); 
 digitalWrite(digit1Pin, HIGH); // set the pin high so no more data can be sent
 }
 else if (digitNumber == 1)
 {
 digitalWrite(digit2Pin, LOW);
 digitalWrite(latchPin, LOW);
 shiftOut(dataPin, clockPin, LSBFIRST, seven_seg_digits[number]);
 digitalWrite(latchPin, HIGH); 
 digitalWrite(digit2Pin, HIGH);
 
 }
 else if (digitNumber == 2)
 {
 digitalWrite(digit3Pin, LOW);
 digitalWrite(latchPin, LOW);
 shiftOut(dataPin, clockPin, LSBFIRST, seven_seg_digits[number]);
 digitalWrite(latchPin, HIGH); 
 digitalWrite(digit3Pin, HIGH);
 }
 else if (digitNumber == 3)
 {
 digitalWrite(digit4Pin, LOW);
 digitalWrite(latchPin, LOW);
 shiftOut(dataPin, clockPin, LSBFIRST, seven_seg_digits[number]);
 digitalWrite(latchPin, HIGH); 
 digitalWrite(digit4Pin, HIGH);

 }


}

 void breakInt(int displayValue){
   
 
   int digitNumber = 4;
   int pkeeper = displayValue/1000;    
     
     displayDigit(pkeeper, digitNumber); 
     displayValue = displayValue - pkeeper*1000;
     pkeeper = displayValue/100;
     
     digitNumber--;
     displayDigit(pkeeper, digitNumber);
     displayValue = displayValue- pkeeper * 100;
     pkeeper = displayValue / 10;
    
     digitNumber--;
     displayDigit(pkeeper, digitNumber);
     displayValue = displayValue - pkeeper * 10;
     pkeeper = displayValue;
    
     digitNumber--;
     displayDigit(pkeeper, digitNumber);
 }

void loop() {
  buttonState=digitalRead(buttonPin);

 if(buttonState==HIGH) {
     analogWrite(motorPin, speed);
  timeElapsed=millis();
 }
 else{
   analogWrite(motorPin,0);
 }
 delay(1000);
    
  displayValue=timeElapsed/1000; 
  breakInt(displayValue);
  Serial.println(displayValue);
  delay(1000);
breakInt(timeElapsed/1000);
 }

Moderator: Code tags added

If you are unable to get the Serial Monitor to correctly show what you want, how do you expect the display to?

You are multiplexing a 4 digit display using 1 shift register.
That means that each digit is, in turn, displayed alone for a maximum of about 5 milliseconds to avoid noticeable flicker.
So you should have a cycle such as:

repeat forever:

switch on pin for digit 1 (all others must be off)
switch on the segments for digit 1
hold this state for, say, 2mS

switch on pin for digit 2 (all others must be off)
switch on the segments for digit 2
hold this state for, say, 2mS

switch on pin for digit 3 (all others must be off)
switch on the segments for digit 3
hold this state for, say, 2mS

switch on pin for digit 4 (all others must be off)
switch on the segments for digit 4
hold this state for, say, 2mS

Your function breakInt() makes no attempt to hold the values in the display for any useful period and in your loop() you have a delay of 1 second which is not compatible with multiplexing driven from the loop().
Don't be tempted to use delay() to hold a digit in the display but use millis() or drive the display controlling function from a timer.