help with - 2 digit 7 segment display and 2 74hc595

You should put it inside of a timer isr so its execution is independent of loop() timing.

Except of course you should never have a delay in an interrupt service routine (ISR) and you should never have a print statement in an ISR.