设总位移为2s,汽车行驶前一半路程所用的时间为:t1= s 30 ; 行驶后一半路程所用的时间为:t2= s 60 ;全程的平均速度: v = 2s s 30 + s 60 =40km/h.故B正确.故选:B.