I guess there is a confusion about the terminology and the associated requirements. What you are referring to in your question is most likely related to requirements of istibrā' (Arabic: الاستبراء), rather than istijmār (Arabic: الاستجمار). Furthermore, there is no religious significance of the "forty yards" in your question.
Istibrā' is attempting to free oneself (barā'a, Arabic: البراءة) of what comes out of a person (walking included until cessation). It is not part of istijmār; it precedes it.
Ibn Abidin said in his gloss (Arabic: حاشية ابن عابدين) that according to the Hanafi madhhab, istibrā' is wājib by walking, shaking one's organ, or by sleeping on the left side (not all for urination), (Arabic: يجب الاستبراء بمشي أو تنحنح أو نوم على شقه الأيسر ويختلف بطباع الناس).
In Fath al-Wahhab (Arabic: فتح الوهاب بشرح منهج الطلاب), Zakariyya al-Ansari mentioned that al-Safi'i madhhab states that one should seek istibrā' through repelling, shaking one's organ, or otherwise (Arabic: بتنحنح ونتر ذكر وغير ذلك). This may include walking if this achieves the objective of ridding one of one's urine (this is the opinion of Al-Jamal, a Shaf'i' scholar).
Mustafa al-Ruhaibani, a Hanbali scholar, has a view that is not very different. He stated in Matālib Uli al-Nahy (Arabic: مطالب أولي النهى في شرح غاية المنتهى) that scholars agreed that a man relieving himself should shake his organ, then some scholars added to walk a few steps but walking is not mandatory.
As you can see, the different schools of jurisprudence have different views on the mandate of walking, but none of them specified a number (forty yards) or required a specific duration (time to walk forty yards). All schools agreed that one should perform istibrā', with walking being an option.
As for istijmār, it is another form of purification after relieving oneself. The requirements are:
- Not to face the qibla
- Not to use one's right hand
- To use a minimum of three pebbles
- Not to use bones or dung.
These conditions can be deduced from the hadith narrated by Salman (quoted below) in addition to other hadiths on the same topic (e.g., the hadith by 'Abdullah ibn Masud in Sahih al-Bukhari, and the hadith in Sunan an-Nasa'i), Musnad Ahmad, Sunan Abu Dawud, and ruled as authentic by Al-Daraqutni):
عَنْ سَلْمَانَ قَالَ قِيلَ لَهُ قَدْ عَلَّمَكُمْ نَبِيُّكُمْ ﷺ كُلَّ شَىْءٍ حَتَّى الْخِرَاءَةَ. قَالَ فَقَالَ أَجَلْ لَقَدْ نَهَانَا أَنْ نَسْتَقْبِلَ الْقِبْلَةَ لِغَائِطٍ أَوْ بَوْلٍ أَوْ أَنْ نَسْتَنْجِيَ بِالْيَمِينِ أَوْ أَنْ نَسْتَنْجِيَ بِأَقَلَّ مِنْ ثَلاَثَةِ أَحْجَارٍ أَوْ أَنْ نَسْتَنْجِيَ بِرَجِيعٍ أَوْ بِعَظْمٍ
Salman reported that it was said to him: Your Apostle (ﷺ) teaches you about everything, even about excrement. He replied: Yes, he has forbidden us to face the Qibla at the time of excretion or urination, or cleansing with the right hand or with less than three pebbles, or with dung or bone.
— Sahih Muslim, Book 2, Hadith 73