Problems to use DHT11 and 7 Segment LED Display

I got problem to use the DHT11 with 7 Segment LED Display driven by 74HC595, actually there is no problem in both but the display is slow down while DHT11 getData() is called in the loop(), even any delay() cannot be used, I can only wrote the getData() in the setup() but it only ran once. I copied code below for yr ref. If there is any method to solve? I'm thinking about if interrupts can be used but how? if getData() can be run in the background and interrupts the loop() periodically?

int humid = 0; int temp = 0; DHT11 dht11(pinDht); void setup (){ // Define the pins as output; pinMode(pinLatch, OUTPUT); pinMode(pinClock, OUTPUT); pinMode(pinData, OUTPUT); delay(2000); getData(); //ledNumberWrite(temp * 100 + humid);

} void loop(){ //getData(); ledNumberWrite(temp * 100 + humid); }

void getData (){ dht11.read(); humid=dht11.getHumidity(); temp=dht11.getTemperature(); //return (temp * 100 + humid); } void ledNumberWrite(int uiTimeDisplay){ ledSegmentWrite(0, uiTimeDisplay / 1000); ledSegmentWrite(1, uiTimeDisplay % 1000 / 100); ledSegmentWrite(2, uiTimeDisplay % 100 / 10); ledSegmentWrite(3, uiTimeDisplay % 10);

} void ledSegmentWrite(byte bSegmentNo, byte bDigitValue){ digitalWrite(pinLatch, LOW); if (bSegmentNo == 1) shiftOut(pinData, pinClock, MSBFIRST, ucCharacterMap[bDigitValue]&0x7F); else shiftOut(pinData, pinClock, MSBFIRST, ucCharacterMap[bDigitValue]); shiftOut(pinData, pinClock, MSBFIRST, ucCharacterBuffer[bSegmentNo] ); digitalWrite(pinLatch, HIGH); }