Skip to main content

Struct TimePeriod

Represents a sub-millisecond-capable Time Period

Assembly: Meadow.Units.dll
View Source
Declaration
[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
Declaration
public static TimePeriod Zero { get; }

Nanoseconds

Gets the time period value in nanoseconds.

View Source
Declaration
public readonly double Nanoseconds { get; }

Microseconds

Gets the time period value in microseconds.

View Source
Declaration
public readonly double Microseconds { get; }

Milliseconds

Gets the time period value in milliseconds.

View Source
Declaration
public readonly double Milliseconds { get; }

Seconds

Gets the time period value in seconds.

View Source
Declaration
public readonly double Seconds { get; }

Minutes

Gets the time period value in minutes.

View Source
Declaration
public readonly double Minutes { get; }

Hours

Gets the time period value in hours.

View Source
Declaration
public readonly double Hours { get; }

Days

Gets the time period value in days.

View Source
Declaration
public readonly double Days { get; }

Methods

From(UnitType)

Converts the current Meadow.Units.TimePeriod value to the specified unit type.

View Source
Declaration
[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
TypeNameDescription
Meadow.Units.TimePeriod.UnitTypeconvertToThe unit type to convert to.

FromSeconds(double)

Creates a new Meadow.Units.TimePeriod from the specified number of seconds.

View Source
Declaration
[Pure]
public static TimePeriod FromSeconds(double seconds)
Returns

Meadow.Units.TimePeriod representing the specified number of seconds.

Parameters
TypeNameDescription
System.DoublesecondsThe number of seconds.

FromMilliseconds(double)

Creates a new Meadow.Units.TimePeriod from the specified number of milliseconds.

View Source
Declaration
[Pure]
public static TimePeriod FromMilliseconds(double milliseconds)
Returns

Meadow.Units.TimePeriod representing the specified number of milliseconds.

Parameters
TypeNameDescription
System.DoublemillisecondsThe number of milliseconds.

FromMicroseconds(double)

Creates a new Meadow.Units.TimePeriod from the specified number of microseconds.

View Source
Declaration
[Pure]
public static TimePeriod FromMicroseconds(double microseconds)
Returns

Meadow.Units.TimePeriod representing the specified number of microseconds.

Parameters
TypeNameDescription
System.DoublemicrosecondsThe number of microseconds.

ToString(string, IFormatProvider)

Converts the Meadow.Units.TimePeriod to its string representation using the specified format and format provider.

View Source
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Returns

System.String: A string representation of the value of the current Meadow.Units.TimePeriod instance.

Parameters
TypeNameDescription
System.StringformatA standard or custom format string.
System.IFormatProviderformatProviderAn object that supplies culture-specific formatting information.

Add(TimePeriod)

Adds the specified Meadow.Units.TimePeriod.

View Source
Declaration
public TimePeriod Add(TimePeriod period)
Returns

Meadow.Units.TimePeriod.

Parameters
TypeNameDescription
Meadow.Units.TimePeriod to add.

CompareTo(object)

Compares a TimePeriod to another object

View Source
Declaration
public int CompareTo(object obj)
Returns

System.Int32

Parameters
TypeNameDescription
System.ObjectobjThe object to compare

CompareTo(TimePeriod)

Compares two TimePeriods

View Source
Declaration
public int CompareTo(TimePeriod other)
Returns

System.Int32

Parameters
TypeName
Meadow.Units.TimePeriodother

CompareTo(TimeSpan)

Compares a TimePeriod to a TimeSpan

View Source
Declaration
public int CompareTo(TimeSpan other)
Returns

System.Int32

Parameters
TypeName
System.TimeSpanother

Implements

  • System.IComparable
  • System.IFormattable
  • System.IComparable<Meadow.Units.TimePeriod>
  • System.IComparable<System.TimeSpan>