# Duration 结构

## 定义

``public value class Duration``
``public struct Duration``
``````[System.Security.SecurityCritical]
public struct Duration``````
``type Duration = struct``
``````[<System.Security.SecurityCritical>]
type Duration = struct``````
``Public Structure Duration``

Duration

## 构造函数

 使用指定的 TimeSpan 值初始化 Duration 结构的新实例。Initializes a new instance of the Duration struct with the specified TimeSpan value.

## 属性

 获取自动确定的 Duration 值。Gets a Duration value that is automatically determined. 获取表示无限间隔的 Duration 值。Gets a Duration value that represents an infinite interval. 获取一个值，该值指示此 Duration 是否表示 TimeSpan 值。Gets a value that indicates if this Duration represents a TimeSpan value. 获取此 Duration 表示的 TimeSpan 值。Gets the TimeSpan value that this Duration represents.

## 方法

 将指定的 Duration 的值添加到 Duration。Adds the value of the specified Duration to this Duration. 将一个 Duration 值与另一个值进行比较。Compares one Duration value to another. 确定指定的 Duration 是否等于此 Duration。Determines whether a specified Duration is equal to this Duration. 确定两个 Duration 值是否相等。Determines whether two Duration values are equal. 确定指定的对象是否等于 Duration。Determines whether a specified object is equal to a Duration. 获取此对象的哈希代码。Gets a hash code for this object. 从此 Duration 中减去指定的 Duration。Subtracts the specified Duration from this Duration. 将 Duration 转换为 String 表示形式。Converts a Duration to a String representation.

## 运算符

 将两个 Duration 值相加。Adds two Duration values together. 确定两个 Duration 案例是否相等。Determines whether two Duration cases are equal. 确定两个 Duration 是否一大一小。Determines if one Duration is greater than another. 确定其中一个 Duration 是否大于或等于另一个。Determines whether a Duration is greater than or equal to another. 依据给定的 Duration 隐式创建 TimeSpan。Implicitly creates a Duration from a given TimeSpan. 确定两个 Duration 案例不相等。Determines if two Duration cases are not equal. 确定 Duration 是否小于另一个实例的值。Determines if a Duration is less than the value of another instance. 确定 Duration 是否小于或等于另一个。Determines if a Duration is less than or equal to another. 从另一个值中减去 Duration 的值。Subtracts the value of one Duration from another. 返回指定的 Duration。Returns the specified Duration.