The Quran was sent down all at once to the lowest heaven on Laylat al-Qadr, and after that it was revealed over the course of twenty years, "And they bring you no argument except that We bring you the truth and a better tafsir" [Furqan 25:33].
أنزل القرآن جملة واحدة إلى السماء الدنيا في ليلة القدر، ثم نزل بعد ذلك بعشرين سنة: {ولا يأتونك بمثل إلا جئنك بالحق وأحسن تفسيرا} [سورة الفرقان: ٣٣].
Nasai narrated it in Sunan al-Kubra (7935) and in Fadail al-Quran (14), and Hakim (2/222), with this being his wording, both from the hadith of Dawud bin Abu Hind, from Ikrima, from Ibn Abbas, who mentioned it. In one wording of Nasai, "Whenever Allah wanted to bring something to pass, it was revealed, and between its beginning and its end there were twenty years." Hakim said, "Its isnad is sahih."His statement "twenty years" either disregards the fraction, or he did not count the period of the pause in revelation, since the established view is that the period of the revelation's descent was twenty-three years, as has already been mentioned.