Time Classes¶
Note
These classes handle time
Alarm Handle¶
-
class
CommonAlarmHandle
(owner: Any, on_alarm_triggered_callback: Callable[[CommonAlarmHandle], None], timeline: sims4communitylib.classes.time.common_alarm_handle.Timeline, when: sims4communitylib.classes.time.common_alarm_handle.DateAndTime, should_repeat: bool = False, time_until_repeat: sims4communitylib.classes.time.common_alarm_handle.TimeSpan = None, accurate_repeat: bool = True, persist_across_zone_loads: bool = False)¶ Bases:
sims4communitylib.classes.time.common_alarm_handle.AlarmHandle
A custom alarm handle that keeps track of when it is slated to trigger for the first time.
-
is_active
¶ True, if the Alarm Handle is currently active and scheduled. False, if not.
-
Stop Watch¶
-
class
CommonStopWatch
¶ Bases:
object
A class used to see how long things take.
-
interval
()¶ Retrieve a time stamp for how long the watch has been running for without ending it.
Returns: The number of seconds that occurred since the stop watch was started. Return type: float
-
interval_milliseconds
()¶ Retrieve a time stamp for how long the watch has been running for without ending it, but in milliseconds.
Returns: The number of milliseconds that occurred since the stop watch was started. Return type: float
-
start
()¶ Start the stop watch.
-
stop
()¶ Stop the stop watch.
Warning
This will also reset the start time of the stop watch. It will also stop the stop watch.
Returns: The number of seconds that occurred since starting the stop watch. Return type: float
-
stop_milliseconds
()¶ Stop the stop watch, but return milliseconds rather than seconds.
Warning
This will also reset the start time of the stop watch. It will also stop the stop watch.
Returns: The number of milliseconds that occurred since starting the stop watch. Return type: float
-