alarm.time
– Trigger an alarm when the specified time is reached.
Create an alarm that will be triggered when time.monotonic()
would equal monotonic_time
, or when time.time()
would equal epoch_time
. Only one of the two arguments can be given. The alarm is not active until it is passed to an alarm
-enabling sleep function, such as alarm.light_sleep_until_alarms()
or alarm.exit_and_deep_sleep_until_alarms()
.
If the given time is already in the past, then an exception is raised. If the sleep happens after the given time, then it will wake immediately due to this time alarm.
Example:
# Deep sleep for 30 seconds. time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 30) alarm.exit_and_deep_sleep_until_alarms(time_alarm)
When this time is reached, the alarm will trigger, based on the time.monotonic()
clock. The time may be given as epoch_time
in the constructor, but it is returned by this property only as a time.monotonic()
time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4