Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompareTo() [1/4]

int System.TimeSpan.CompareTo ( object? value)
inline

Implements System.IComparable< in T >.

Definition at line 126 of file TimeSpan.cs.

127 {
128 if (value == null)
129 {
130 return 1;
131 }
132 if (!(value is TimeSpan))
133 {
134 throw new ArgumentException(SR.Arg_MustBeTimeSpan);
135 }
136 long ticks = ((TimeSpan)value)._ticks;
137 if (_ticks > ticks)
138 {
139 return 1;
140 }
141 if (_ticks < ticks)
142 {
143 return -1;
144 }
145 return 0;
146 }
TimeSpan(long ticks)
Definition TimeSpan.cs:78
readonly long _ticks
Definition TimeSpan.cs:27

References System.TimeSpan.TimeSpan(), System.TimeSpan._ticks, System.SR.Arg_MustBeTimeSpan, and System.value.

Referenced by System.Data.Common.TimeSpanStorage.CompareValueTo(), and System.TimeZoneInfo.GetSystemTimeZones().