Abu Juhaym ibn al-Hārith ibn As-Simmah al-Ansāri (may Allah be pleased with him) reported directly from the Messenger of Allah (may Allah's peace and blessings be upon him) that he said: "If the one passing in front of a person who is praying would know the gravity of his sin, it would have been better for him to stand for forty than to pass in front him." Abu An-Nadr said: "I am not sure if he said forty days, months, or years. [Sahih/Authentic] - [Al-Bukhari and Muslim]
عن أبي جُهَيْمِ بْنِ الْحَارِثِ بْنِ الصِّمَّةِ الأنصاري -رضي الله عنه- مرفوعاً: «لو يعلم المار بين يدي الْمُصَلِّي ماذا عليه لكان أن يَقِفَ أربعين خيرا له من أن يَمُرَّ بين يديه». قال أَبُو النَّضْرِ: لا أدري: قال أربعين يوما أو شهرا أو سنة. [صحيح.] - [متفق عليه.]