Duration Class

A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.

Definition

Namespace: GenerativeAI.Types
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class Duration
Inheritance
Object    Duration

Constructors

DurationInitializes a new instance of the Duration class

Properties

Nanos Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 Seconds field and a positive or negative Nanos field. For durations of one second or more, a non-zero value for the Nanos field must be of the same sign as the Seconds field. Must be from -999,999,999 to +999,999,999 inclusive.
Seconds Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
FromTimeSpan Creates a new Duration object from a TimeSpan object.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)
ToTimeSpan Converts this Duration object to a TimeSpan object.

Operators

(Duration to TimeSpan) Implicitly converts a Duration object to a TimeSpan object.
(TimeSpan to Duration) Implicitly converts a TimeSpan object to a Duration object.

See Also