ArcGIS Pro 2.7 API Reference Guide
Duration Property (Animation)
Example 

ArcGIS.Desktop.Mapping Namespace > Animation Class : Duration Property
Gets the length of time of all tracks in the animation.
Syntax
public TimeSpan Duration {get;}
Public ReadOnly Property Duration As TimeSpan
Example
Set the length of the animation.
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 10, Windows 8.1

See Also

Reference

Animation Class
Animation Members