@@ -0,0 +1,1088 @@
+# Short demo of the Clock service%0A%0A# First we need to create an instance of the service%0Aclock = Runtime.create(%22clock%22,%22Clock%22)%0A%0A# Next we need to set the pulse interval%0Aclock.setInterval(1000)%0A%0A# There are three possible call back methods%0A# lets create them next%0A# Don't forget, if you have multiple clock services running,%0A# you will need to create multiple call back methods,%0A# each with a unique name.%0Adef ClockPulse(timedata)%0A    print %22The clock has pulsed%22%0A%0Adef ClockStart():%0A    print %22The CLock has started%22%0A%0Adef ClockStopped()%0A    print %22The Clock has been stopped%22%0A%0A# next we need to add a listener to call our call back methods.%0Aclock.addListener(%22pulse%22, python.name, %22ClockPulse%22)%0Aclock.addListener(%22clockStarted%22, python.name, %22ClockStart%22)%0Aclock.addListener(%22clockStopped%22, python.name, %22ClockStopped%22)%0A%0A# Finally, we need to start the clock.%0Aclock.startClock(1)%0A%0A# If the clock is used as part of a watchdog service or a sleep timer,%0A# we may need to restart the clock%0Aclock.restartClock(1)%0A%0A# When we don't need the clock running, then we can stop it.%0Aclock.stopClock()%0A

Create Clock2.py