The Prophet ﷺ said, "As long as any-one of you is waiting for the prayer, he is considered to be praying actually, and the angels say, 'O Allah! Be merciful to him and forgive him', (and go on saying so) unless he leaves his place of praying or passes wind (i.e. breaks his ablution).
عَنِ النَّبِيِّ ﷺ قَالَ إِنَّ أَحَدَكُمْ فِي صَلاَةٍ مَا دَامَتِ الصَّلاَةُ تَحْبِسُهُ وَالْمَلاَئِكَةُ تَقُولُ اللَّهُمَّ اغْفِرْ لَهُ وَارْحَمْهُ مَا لَمْ يَقُمْ مِنْ صَلاَتِهِ أَوْ يُحْدِثْ