Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
As to what follows:
In response to your question, we say, and with Allah Almighty lies all success:
The amount of time between the shock, i.e. the death of all of creation, and the resurrection, is mentioned in what Bukhari and Muslim have reported from Abu Hurayrah (may Allah be pleased with him) who narrated that the Messenger of Allah (peace be upon him) said, “Between the two blowings of the horn – i.e. the blowing of shock and the blowing of resurrection – there will be an interval of forty. Then Allah will send water from the sky and they [the dead] will grow like vegetation grows. There is nothing of the human body that does not decay except one bone; that is the little bone at the end of the coccyx of which the human body will be recreated on the Day of Resurrection.”
It is mentioned in Bukhari that Abu Hurayrah was asked, “O Abu Hurayrah, forty days?” He said, “I refuse to say.” Then they asked, “Forty months?” He said, “I refuse to say.” Then they asked, “Forty years?” He said, “I refuse to say.”
So Abu Hurayrah did not mention the time period, whether it will be in years, months, or days; and it seems that he did not hear that from the Prophet (peace be upon him), thus stopping at what he heard, and whoever ends at what he hears has indeed done well; although it has been reported in some narrations that it will be forty years, but these reports are inauthentic.
Thus, we say that the time period between the shock and the resurrection will be forty, and we cease from determining the amount.
As for explaining what is meant by this time period, what is evident – and Allah knows best – is that it will be the time period to separate the life of this world from the hereafter, in order to make a distinction between the two. And as for the reason it will be forty, this is something of which no clarification has reached us concerning it from Allah or His Messenger, nor did the Salaf (may Allah have mercy on them) from the companions and their followers speak concerning it, so we stop where they stopped. And it is not correct to come up with a reason for the time period by way of opinion, as there is no room for opinion in this area.