I used to go to the Prophet ﷺ and ask permission to enter. If he was praying, he would say Subhan Allah, and if he was not praying, he would give me permission to enter.
عَلِيٌّ كُنْتُ آتِي النَّبِيَّ ﷺ فَأَسْتَأْذِنُ فَإِنَّ كَانَ فِي صَلاةٍ سَبَّحَوَإِنْ كَانَ فِي غَيْرِ صَلاةٍ أَذِنَ لِي