AA 4038 then UA 5940 at O'Hare
Madison → Chicago → Peoria
Timetable, Chicago time
16:44AA 4038 from Madison at the gate
16:40UA 5940 to Peoria leaves the gate
23 h 56 apart on the timetable, overnight
UA 5940 leaves 23 h 56 after AA 4038 arrives on the timetable: more than half a day, so not a connection we count.