ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Animation Class / ScaleDuration Method / ScaleDuration(Double) Method
The factor to scale by.
Example Version

ScaleDuration(Double) Method
Adjust the length of the animation by a given scale factor.
Syntax
public void ScaleDuration( 
   double factor
)

Parameters

factor
The factor to scale by.
Example
Set Animation Length
public void SetAnimationLength(TimeSpan length)
{
  var mapView = MapView.Active;
  if (mapView != null)
    return;

  var animation = mapView.Map.Animation;
  var duration = animation.Duration;
  if (duration == TimeSpan.Zero)
    return;

  var factor = length.TotalSeconds / duration.TotalSeconds;
  animation.ScaleDuration(factor);
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also