RouteItinerary.TripTime Property

The total amount of travel time for a route in seconds. Long.

Public Dim TripTime As Long
    Member of [Namespace].RouteItinerary
[C#]
public System.Int64 TripTime
    Member of [Namespace].RouteItinerary

Remarks

  • The TripTime property includes non-driving travel time, such as time elapsed during autorail or ferry travel, or any non-driving time specified in the RouteSpecification.DriverProfile property.

Example

 
[Visual Basic] 
'This example assumes that the service instance 
''routeService' has already been created and that 
'the MapPoint Web Service namespace has been imported 

'Calculate a route and print the route 
'distance, driving time, and total trip time
Dim latLongs(1) As LatLong
latLongs(0) = New LatLong()
latLongs(0).Latitude = 40
latLongs(0).Longitude = -120
latLongs(1) = New LatLong()
latLongs(1).Latitude = 41
latLongs(1).Longitude = -121

Dim myRoute As Route
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest)

Console.WriteLine("Total Trip Time: " + (myRoute.Itinerary.TripTime / 60).ToString() + " minutes")
Console.WriteLine("Driving Time: " + (myRoute.Itinerary.DrivingTime / 60).ToString() + " minutes")
Console.WriteLine("Total Trip Distance: " + myRoute.Itinerary.Distance.ToString())

 
[C#]
//This example assumes that the service instance 
//'routeService' has already been created and that 
//the MapPoint Web Service namespace has been imported 

//Calculate a route and print the route 
//distance, driving time, and total trip time
LatLong[] latLongs = new LatLong[2];
latLongs[0] = new LatLong();
latLongs[0].Latitude = 40;
latLongs[0].Longitude = -120;
latLongs[1] = new LatLong();
latLongs[1].Latitude = 41;
latLongs[1].Longitude = -121;

Route myRoute;
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest);

Console.WriteLine("Total Trip Time: " + (myRoute.Itinerary.TripTime / 60).ToString() + " minutes");
Console.WriteLine("Driving Time: " + (myRoute.Itinerary.DrivingTime / 60).ToString() + " minutes");
Console.WriteLine("Total Trip Distance: " + myRoute.Itinerary.Distance.ToString());

 

See Also

RouteItinerary Class | RouteSpecification.DriverProfile Property