Integrated duplicate code into checkDelayTime().