Abdullah bin Amr bin As reported,

I heard the Messenger of Allah ﷺ say, "Allah recorded the measurements of all creation fifty thousand years before He created the heavens and the earth." He added, "And His Throne was upon the water."

Azami 8198

Sahih

عن عبد الله بن عمرو بن العاص، قال

سمعت رسول الله ﷺ يقول: كتب الله مقادير الخلائق قبل أن يخلق السماوات والأرض بخمسين ألف سنة، قال: وكان عرشه على الماء.

الأعظمي 8198صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Beginning of creation
Section
Allah created the pen after the Throne and the water
Numbering
Jami al-Kamil 8198 (2nd edition)
Azami 8198