[Machine] The Prophet (PBUH) stayed in Mecca for fifteen or eighteen years, seeing the light and hearing the voice, and for eight years receiving inspiration. He lived in Medina for ten years.
أَقَامَ النَّبِيُّ ﷺ بِمَكَّةَ خَمْسَ عَشْرَةَ سَنَةً سَبْعًا أَوْ ثَمَانِيًا يَرَى الضَّوْءَ وَيَسْمَعَ الصَّوْتَ وَثَمَانِيًا يُوحَى إِلَيْهِ وَأَقَامَ بِالْمَدِينَةِ عَشْرًا