[Machine] Pray the prayer at its appointed time, then leave. But if you are in the mosque and the prayer has been established, then pray with them.
صَلِّ الصَّلَاةَ لِوَقْتِهَا ثُمَّ اخْرُجْ فَإِنْ كُنْتَ فِي الْمَسْجِدِ فَأُقِيمَتِ الصَّلَاةُ فَصَلِّ مَعَهُمْ