What determines the "time"? It is the fall of the object due to gravity
While gravity doesn't affect the motion in the horizontal direction, it affects the time taken
for the object to move! That is how gravity comes in!
You should go back and resolve this problem, and pay attention to what factors determine the time of motion that you used for the horizontal component.