When a ball is tossed straight upward, it will experience a constant acceleration due to gravity, directed downward. The value of this acceleration is g = 9.8 m/s^2.
Since the direction of the acceleration is opposite to the direction of the velocity, the magnitude of the velocity will diminish as the ball goes up, until it becomes 0. At this point, the velocity will change direction to downward, and the ball will start falling. So, at the top of the path, the velocity of the ball is 0.
The time it takes the ball to reach the top of its path can be calculated using the equation of motion
`vec v_f = vecv_i + vecg *t` .
If the coordinate axis is directed upward, and since at the top of the path `vec v_f = vec0` , the equation becomes
`0 = v_i - g*t`
From here, `t = (v_i /g) = 5/9.8 = 0.51 s`
It will take the ball 0.51 seconds to reach the top of its path.