Allah does not punish instantly
Surah No. 16, An Nahl, Ayat No. 61
وَلَوْ يُؤَاخِذُ اللَّهُ النَّاسَ بِظُلْمِهِمْ مَا تَرَكَ عَلَيْهَا مِنْ دَابَّةٍ وَلَكِنْ يُؤَخِّرُهُمْ إِلَى أَجَلٍ مُسَمًّى فَإِذَا جَاءَ أَجَلُهُمْ لَا يَسْتَأْخِرُونَ سَاعَةً وَلَا يَسْتَقْدِمُونَ
If Allah were to punish men for their wrongdoing instantly, He would not leave, a single living creature on the (earth),: but He gives them respite for an appointed Term: when their Term comes they cannot delay (the punishment) for an hour, nor can advance it.