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