Not quite. First, %foo isn't defined. Second, announce isn't a method of any class. Third, you've got the syntax a bit wrong.
So, just remove %foo. all together. That leaves schedule(time, "function(parameters)"). This is still a bit wrong, you have to use a 0 as the second parameter and the function as the third, with the arguments for that function in following slots. So, correct would be schedule(time, 0, function, "message")