Struct TimePeriod
Represents a sub-millisecond-capable Time Period
Assembly: Meadow.Units.dll
View Source
[Serializable]
public struct TimePeriod : IComparable, IFormattable, IComparable<TimePeriod>, IComparable<TimeSpan>
Implements:
System.IComparable
, System.IFormattable
, System.IComparable<Meadow.Units.TimePeriod>
, System.IComparable<System.TimeSpan>
Properties
Zero
Gets a TimePeriod of zero time
View Source
public static TimePeriod Zero { get; }
Nanoseconds
Gets the time period value in nanoseconds.
View Source
public readonly double Nanoseconds { get; }
Microseconds
Gets the time period value in microseconds.
View Source
public readonly double Microseconds { get; }
Milliseconds
Gets the time period value in milliseconds.
View Source
public readonly double Milliseconds { get; }
Seconds
Gets the time period value in seconds.
View Source
public readonly double Seconds { get; }
Minutes
Gets the time period value in minutes.
View Source
public readonly double Minutes { get; }
Hours
Gets the time period value in hours.
View Source
public readonly double Hours { get; }
Days
Gets the time period value in days.
View Source
public readonly double Days { get; }
Methods
From(UnitType)
Converts the current Meadow.Units.TimePeriod value to the specified unit type.
View Source
[Pure]
public readonly double From(TimePeriod.UnitType convertTo)
Returns
System.Double
: The value of the current Meadow.Units.TimePeriod in the specified unit type.
Parameters
Type | Name | Description |
---|---|---|
Meadow.Units.TimePeriod.UnitType | convertTo | The unit type to convert to. |
FromSeconds(double)
Creates a new Meadow.Units.TimePeriod from the specified number of seconds.
View Source
[Pure]
public static TimePeriod FromSeconds(double seconds)
Returns
Meadow.Units.TimePeriod representing the specified number of seconds.
Parameters
Type | Name | Description |
---|---|---|
System.Double | seconds | The number of seconds. |
FromMilliseconds(double)
Creates a new Meadow.Units.TimePeriod from the specified number of milliseconds.
View Source
[Pure]
public static TimePeriod FromMilliseconds(double milliseconds)
Returns
Meadow.Units.TimePeriod representing the specified number of milliseconds.
Parameters
Type | Name | Description |
---|---|---|
System.Double | milliseconds | The number of milliseconds. |
FromMicroseconds(double)
Creates a new Meadow.Units.TimePeriod from the specified number of microseconds.
View Source
[Pure]
public static TimePeriod FromMicroseconds(double microseconds)
Returns
Meadow.Units.TimePeriod representing the specified number of microseconds.
Parameters
Type | Name | Description |
---|---|---|
System.Double | microseconds | The number of microseconds. |
ToString(string, IFormatProvider)
Converts the Meadow.Units.TimePeriod to its string representation using the specified format and format provider.
View Source
public string ToString(string format, IFormatProvider formatProvider)
Returns
System.String
: A string representation of the value of the current Meadow.Units.TimePeriod instance.
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A standard or custom format string. |
System.IFormatProvider | formatProvider | An object that supplies culture-specific formatting information. |
Add(TimePeriod)
Adds the specified Meadow.Units.TimePeriod.
View Source
public TimePeriod Add(TimePeriod period)
Returns
Parameters
Type | Name | Description |
---|---|---|
Meadow.Units.TimePeriod to add. |
CompareTo(object)
Compares a TimePeriod to another object
View Source
public int CompareTo(object obj)
Returns
System.Int32
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare |
CompareTo(TimePeriod)
Compares two TimePeriods
View Source
public int CompareTo(TimePeriod other)
Returns
System.Int32
Parameters
Type | Name |
---|---|
Meadow.Units.TimePeriod | other |
CompareTo(TimeSpan)
Compares a TimePeriod to a TimeSpan
View Source
public int CompareTo(TimeSpan other)
Returns
System.Int32
Parameters
Type | Name |
---|---|
System.TimeSpan | other |
Implements
System.IComparable
System.IFormattable
System.IComparable<Meadow.Units.TimePeriod>
System.IComparable<System.TimeSpan>