The time to reach its highest point is just 2 seconds --- the time needed to lose 20 m/s of speed.
The downward trajectory is exactly the the upward one played backwards and will take the same amount of time --- 2 seconds.
Total time = 2 s + 2 s = 4 s.