Skip to content

Commit

Permalink
feat: add duration property to TIntervalLoops
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Aug 6, 2023
1 parent e877dc5 commit 009c236
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/useq/_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class TIntervalLoops(TimePlan):
interval: timedelta
loops: int = Field(..., gt=0)

@property
def duration(self) -> datetime.timedelta:
return self.interval * (self.loops - 1)


class TDurationLoops(TimePlan):
"""Define temporal sequence using duration and number of loops.
Expand Down

0 comments on commit 009c236

Please sign in to comment.