You lose the most time in the steep sections.
As a rough example, using
220 watts from
this calculator:
1 km 3% grade: 22.4 kph = 1/22.4 = .045 hours or 161 seconds.
1 km 8% grade: 11.3 kph = 1/11.3 = .088 hours or 318 seconds. About 2/3 of the total time.
Total time is 161+318 seconds = 8 minutes.
For 250 watts
1km, 3% 24.4 kph = 1/24.4 is 148 seconds. 13 seconds less.
1km, 8% 12.8 kph = 1/12.8 is 281 seconds. 37 seconds less.
This calculates to 148+281 = 7 minutes.
But you'll notice that it takes a lot more power to go faster. Reaching 4 minutes from 6 minutes will be a lot of work. Your real hill isn't exactly 3% then exactly 8%, so this is just an example.