The average speed of an object is defined  by
                     v = s/t
where v is the average speed, s is the distance travelled and t is the duration of the trip.  "Distance travelled" means the length of the path followed by the object.  This is different from the displacement of the object.  For instance, if you swim a 100 m race in a 50 m swiming pool, then your distance travelled is 100 m but your displacement is approximately zero, because you end up where you started.  If your swim takes 80 seconds, then your speed is 100 m / 80 s = 1.25 m/s.  However, your average velocity is zero, because average velocity is displacement divided by duration.   So remember that speed and distance traveled refer to motion along the path, whereas displacement and velocity refer to the difference between the starting position and the ending position.