The time depends on the amount of equipment that performs the calculations, that is, the more they are, the more they increase the computing power called Hash.
This power decreases the resolution of the block but the characteristic of bitcoin is that on average each block is executed in 10min.
In addition, the Bitcoin system is programmed that the difficulty of resolving each block is fixed every 14 days.
This difficulty determines the extraction time which makes sure to always stay around 10 min.
This means that the occurrence of halving always occurs around 4 years.
The halving of bitcoins means that it will reach 0 within approximately 2140 years, causing bitcoin to become a limited and no longer extractable resource.
Obviously miners will have to try harder and harder to find a solution to halving through new computing equipment.
For this article, everything is waiting for you.