I've written a 7-segment refresh routine that runs every 2 millis at the beginning of loop(). It starts this way:
void loop() {
CURmillis = millis();
if ((CURmillis - PREVmillis) > 1) { // 2ms refresh period = 71 Hz per segment
digitalWrite(18,HIGH);
PREVmillis = CURmillis;
// Turn the current segment OFF while making changes - prevents ghosting
digitalWrite(SEGARRAY[SEGCOUNT], SEGOFF);
The digitalWrite to pin 18 has been added so I can measure how long the refresh routine takes to run. Pin 18 is turned off as the last instruction in loop(). S