From a3ee10a2afbbbf50f610290787cdb1a9ec89c437 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 19 Feb 2014 09:15:48 +0100 Subject: update every 5:th second instead of every minute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/comprehensive | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/comprehensive') diff --git a/examples/comprehensive b/examples/comprehensive index 26abc3c..f033d27 100644 --- a/examples/comprehensive +++ b/examples/comprehensive @@ -155,8 +155,10 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): (*) Can be exceeded if the calendar system is changed, like in 1712-(02)Feb-30 (**) See https://en.wikipedia.org/wiki/Leap_second ''' - global last_dayness + global last_dayness, wait_period + dayness = get_dayness() + # Do not do unnecessary work if fade is None: if dayness == last_dayness: return @@ -223,6 +225,9 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): randr() else: randr(m) + + # Lets wait only 5 seconds, instead of a minute before running again + wait_period = 10 def reset(): -- cgit v1.2.3-70-g09d2