Class TimeRange
- Namespace
- DotCompute.Runtime.Services.Performance.Types
- Assembly
- DotCompute.Runtime.dll
A class that represents time range.
public record TimeRange : IEquatable<TimeRange>
- Inheritance
-
TimeRange
- Implements
- Inherited Members
Constructors
TimeRange(DateTime, DateTime)
A class that represents time range.
public TimeRange(DateTime Start, DateTime End)
Parameters
Properties
Duration
Gets the duration of this time range. Calculates the time span between start and end.
public TimeSpan Duration { get; }
Property Value
End
The end time of the range.
public DateTime End { get; init; }
Property Value
Start
The start time of the range.
public DateTime Start { get; init; }
Property Value
Methods
Contains(DateTime)
Determines if a given time falls within this range.
public bool Contains(DateTime time)
Parameters
timeDateTimeThe time to check.
Returns
- bool
True if the time is within the range, false otherwise.
Overlaps(TimeRange)
Determines if this range overlaps with another range.
public bool Overlaps(TimeRange other)
Parameters
otherTimeRangeThe other time range.
Returns
- bool
True if the ranges overlap, false otherwise.