# This is a simple example of using the builtin object timer
# capabilities.

# we create a new object
%bomb = $new(object,0,myobject)

# implement its timerEvent
privateimpl(%bomb,timerEvent)
{
	if($$->%secsToGo > 0)
	{
		echo "Countdown: $$->%secsToGo"
		$$->%secsToGo--;
	} else {
		echo "Boom!"
		delete $this
	}
}

# and trigger it
echo "Countdown: 10 seconds to go"
%bomb->%secsToGo = 9
%bomb->$startTimer(1000)

# now just have to wait...
