It took Madara a lot of time unless I'm incorrect.
The Rinnegan can be awakened by combining the chakra of Hagoromo's sons, Indra and Asura, in order to create Hagoromo's chakra.[6] Black Zetsu spent centuries attempting to do so, trying to manipulate the reincarnations of Indra and Asura to awaken the Rinnegan.[7] It was not until the time of Madara Uchiha - Indra's reincarnation - that Black Zetsu was successful, when Madara infused himself with the DNA of Hashirama Senju - Asura's reincarnation. However, Madara's Sharingan did not become Rinnegan until decades later, at the end of his natural lifespan; this also seemingly restored the eyesight lost from his use of Izanagi.[8] When Kabuto Yakushi reincarnated Madara, he operated under a similar hypothesis that Sharingan can be evolved into Rinnegan through combination with Hashirama's DNA. To that end he successfully recreated the Rinnegan in Madara's reincarnated body,[9] though these fake eyes didn't have full access to the original's abilities.[10]