Added TimeRange.getMiddle()
This commit is contained in:
parent
9c9d79c54d
commit
4dc9d4253e
|
@ -31,6 +31,10 @@ time_type TimeRange::getDuration() const {
|
|||
return end - start;
|
||||
}
|
||||
|
||||
time_type TimeRange::getMiddle() const {
|
||||
return (start + end) / 2;
|
||||
}
|
||||
|
||||
bool TimeRange::empty() const {
|
||||
return start == end;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ public:
|
|||
time_type getStart() const;
|
||||
time_type getEnd() const;
|
||||
time_type getDuration() const;
|
||||
time_type getMiddle() const;
|
||||
bool empty() const;
|
||||
|
||||
void setStart(time_type newStart);
|
||||
|
|
Loading…
Reference in New Issue