Timer¶
- class Timer(start_time: Time, duration: TimeInterval)¶
Bases:
objectTimerobject.Attributes¶
start_timeTimeStart time after which the timer is active.
durationTimeIntervalTime duration of the timer, starting from
start_time.
Methods¶
is_active()It checks if the simulation
current_timeis greater than or equal tostart_timebut lower than or equal to the sum ofcurrent_timeandduration.
- property duration: TimeInterval¶
Time duration of the timer, starting from
start_time.Returns¶
TimeIntervalTime duration of the timer, starting from
start_time.
Raises
TypeErrorIf
durationis not an instance ofTimeInterval.
- is_active(current_time: Time) bool¶
It checks if the simulation
current_timeis greater than or equal tostart_timebut lower than or equal to the sum ofcurrent_timeandduration.Parameters¶
current_timeTimeCurrent time of the simulation, to be compared with
start_timeandduration.
Returns¶
boolWhether
current_timeis greater than or equal tostart_timebut lower than or equal to the sum ofstart_timeandduration.
Raises
TypeErrorIf
current_timeis not an instance ofTime.