Inner Drive Extensible Architecture

## Time Structure |

Represents a discrete interval of time.

Inheritance Hierarchy

Syntax

C#

[SerializableAttribute] [JsonObjectAttribute(ItemTypeNameHandling = TypeNameHandling.Auto)] public struct Time : IAdditionOperators<Time, Time, Time>, IAdditionOperators<Time, double, Time>, IAdditionOperators<Time, int, Time>, ICloneable, IComparable, IComparable<Time>, IComparisonOperators<Time, Time, bool>, IEqualityOperators<Time, Time, bool>, IComparisonOperators<Time, double, bool>, IEqualityOperators<Time, double, bool>, IConvertible<Time>, IDivisionOperators<Time, double, Time>, IDivisionOperators<Time, int, Time>, IEquatable<Time>, IMeasurable, IFormattable, IMinMaxValue<Time>, IMultiplyOperators<Time, double, Time>, IMultiplyOperators<Time, int, Time>, ISubtractionOperators<Time, Time, Time>, ISubtractionOperators<Time, double, Time>, ISubtractionOperators<Time, int, Time>, IUnaryNegationOperators<Time, Time>, ISpanFormattable

The Time type exposes the following members.

Constructors

Name | Description | |
---|---|---|

Time(Double) | Creates a new instance of Time with a particular value. | |

Time(TimeSpan) | Creates a new instance of Time from a TimeSpan. | |

Time(Double, Type) | Creates a new instance of Time with a particular value and Unit whose Type is specified | |

Time(Double, Unit, MetricExponent) | Creates a new instance of Time with a particular value and Unit. |

Properties

Name | Description | |
---|---|---|

Accuracy | Represents the degree confidence that the quantity represented equals the quantity actually measured, controlling how the CompareTo<T> method behaves. | |

DefaultUnit |
Gets the Type of the Unit in which the
IMeasurableclass is denominated.
| |

MaxValue | Gets the maximum value of the current type. | |

MinValue | Gets the minimum value of the current type. | |

Name | Gets the name of the type of measurement. | |

Precision | Represents the range within which the measurement is correct, controlling how the ToString() method behaves. | |

Unit | Gets the Unit in which the IMeasurable object is denominated. | |

Value | Gets or sets the quantity of units represented by the IMeasurable object. |

Methods

Name | Description | |
---|---|---|

Add(Time, Time) | Adds two instances of Time together. | |

Add(Time, Double) | Adds an instance of Time to an instance of Double. | |

Clone | Creates a new object that is a copy of the current instance. | |

CompareTo | Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. | |

ConvertTo(Type) | Converts the instance into a new IMeasurable instance denominated in the measurement units provided. | |

ConvertTo(Unit) | Converts the instance into a new instance of the same type denominated in the measurement units provided. | |

Divide | Divides an instance of Time by a double-precision value. | |

Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides ValueTypeEquals(Object)) | |

Equals(Time) | Indicates whether the current object is equal to another object of the same type. | |

Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |

GetHashCode | Returns the hash code for this instance. (Overrides ValueTypeGetHashCode) | |

GetType | Gets the Type of the current instance. (Inherited from Object) | |

IsInfinity | Returns a value indicating whether the specified number evaluates to negative or positive infinity. | |

IsNaN | Returns a value indicating whether the specified number evaluates to a value that is not a number (NaN). | |

IsNegativeInfinity | Returns a value indicating whether the specified number evaluates to negative infinity (NegativeInfinity). | |

IsPositiveInfinity | Returns a value indicating whether the specified number evaluates to positive infinity (PositiveInfinity). | |

MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |

Multiply | Multiplies an instance of Time by a double-precision value. | |

Negate | Negates the value of the specified Time operand. | |

Subtract(Time, Time) | Subtracts one instance of Time from another. | |

Subtract(Time, Double) | Subtracts an instance of Double from an instance of Time. | |

ToString | Returns the fully qualified type name of this instance. (Overrides ValueTypeToString) | |

ToString(MetricExponent) | Converts the numeric value of this instance to its equivalent String representation, using the metric exponent provided if appropriate to the Unit type. | |

ToString(String) | Converts the numeric value of this instance to its equivalent String representation, using the specified format. | |

ToString(String, MetricExponent) | Converts the numeric value of this instance to its equivalent String representation, using the specified format and metric exponent. | |

ToString(String, IFormatProvider) | Formats the value of the current instance using the specified format. | |

ToString(String, MetricExponent, IFormatProvider) | Formats the value of the current instance using the specified format. | |

TryFormat | Tries to format the value of the current instance into the provided span of characters. |

Operators

Name | Description | |
---|---|---|

Addition(Time, Time) | Adds two values together to compute their sum. | |

Addition(Time, Double) | Adds two values together to compute their sum. | |

Addition(Time, Int32) | Adds two values together to compute their sum. | |

Division(Time, Double) | Divides one value by another to compute their quotient. | |

Division(Time, Int32) | Divides one value by another to compute their quotient. | |

Equality(Double, Time) | Compares an instance of Time with an instance of Double for equality. | |

Equality(Time, Time) | Compares two values to determine equality. | |

Equality(Time, Double) | Compares two values to determine equality. | |

GreaterThan(Double, Time) | Compares an instance of Time to an instance of Double for different values. | |

GreaterThan(Time, Time) | Compares two values to determine which is greater. | |

GreaterThan(Time, Double) | Compares two values to determine which is greater. | |

GreaterThanOrEqual(Double, Time) | Compares an instance of Time to an instance of Double for different values. | |

GreaterThanOrEqual(Time, Time) | Compares two values to determine which is greater or equal. | |

GreaterThanOrEqual(Time, Double) | Compares two values to determine which is greater or equal. | |

(Double to Time) | Creates a new Time object from a Double value. | |

(Time to Double) | Creates a new Double value from a given Time object. | |

Inequality(Double, Time) | Compares an instance of Time with an instance of Double for inequality. | |

Inequality(Time, Time) | Compares two values to determine inequality. | |

Inequality(Time, Double) | Compares two values to determine inequality. | |

LessThan(Double, Time) | Compares an instance of Time to an instance of Double for different values. | |

LessThan(Time, Time) | Compares two values to determine which is less. | |

LessThan(Time, Double) | Compares two values to determine which is less. | |

LessThanOrEqual(Double, Time) | Compares an instance of Time to an instance of Double for different values. | |

LessThanOrEqual(Time, Time) | Compares two values to determine which is less or equal. | |

LessThanOrEqual(Time, Double) | Compares two values to determine which is less or equal. | |

Multiply(Time, Double) | Multiplies two values together to compute their product. | |

Multiply(Time, Int32) | Multiplies two values together to compute their product. | |

Subtraction(Time, Time) | Subtracts two values to compute their difference. | |

Subtraction(Time, Double) | Subtracts two values to compute their difference. | |

Subtraction(Time, Int32) | Subtracts two values to compute their difference. | |

UnaryNegation(Time) | Computes the unary negation of a value. |

Fields

Name | Description | |
---|---|---|

Epsilon | Represents the smallest value of Accuracy that will successfully evaluate equality without boundary condition errors. | |

MaxPrecision | Represents the maximum precision with which a value can be displayed. | |

MinPrecision | Represents the minimum precision with which a value can be displayed. |

Explicit Interface Implementations

Name | Description | |
---|---|---|

IComparableCompareTo | Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. |

Remarks

This class differs from the TimeSpan in that
its primary purpose is to represent human-readable intervals
of time in discrete chunks. For example, while the TimeSpan
is concerned with the passage of time between two events, the Time
class is concerned with what to call that interval.

See Also