Segment.TripTime Property
Segment.TripTime Property
The total amount of travel time for a route segment in seconds.
Public TripTime As System.Long
[C#]
public System.Int64 TripTime;
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]
'Calculate a route and print the total time
'from the first waypoint to the second
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 time from the first waypoint to the second: " _
+ (myRoute.Itinerary.Segments(0).TripTime / 60).ToString() + " minutes")
[C#]
//Calculate a route and print the total time
//from the first waypoint to the second
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 time from the first waypoint to the second: "
+ (myRoute.Itinerary.Segments[0].TripTime / 60).ToString() + " minutes");
See Also
Segment Class | RouteSpecification.DriverProfile Property