To expand on
@Not Yet Implemented bought up, it's not necessarily a simple question - it depends on what the code for it looks like. If you're skilled and spent the right amount of time up front building a system with all the functionality and contingencies, it's butter-smooth and takes no time at all, but if you're trash, poorly-specced the thing, realized it's got incomplete functionality, resists expansion or adjustment and you coded it in such away that you're fighting uphill against the system just trying to work with it, then it takes longer.
It's almost like you're asking how long it takes to build a birdhouse, but before we can answer that, we have to discuss the tools you assembled for the job - did you make yourself a drill and tablesaw, or are you doing some sticks and rocks caveman shit that's more likely to hurt you, break and need to be fixed before it does anything of value, putting aside how slow it is? There's a lot of things like that in coding, where you get bit in the ass for building something badly up front by accruing "technical debt" that slows you down and costs you more time over the lifetime of the project.
Of course, the complicating factor is that a lot of prefab solutions do exist depending on your environment, a lot of IDEs like GameMaker have user-built tools that can handle a lot of the basic functionality a lot of people prefer to use to spare themselves the time investment in building a toolset, though there's still valid reasons to hold out and do it yourself such as the desire to learn or because the game you want to make needs some unique non-generic features.