Average Time Interval between a Start and End Time

Looking to get the average time interval between a start and an end time (ex: Given the start and end times for runners in a race, find the average time it takes for a runner to complete the race)? Find exactly how to write this up in each flavor of SQL below!

Redshift

select avg(extract(epoch from endtime) - extract(epoch from starttime)) as avg_time