Benjamin threw a rock straight up from a cliff that was 40 feet above the water. If the height of the rock h, in feet, after t seconds is given by the equation h=-16t^2+12t+40, how long will it take for the rock to hit the water?