I email the mailing list and then found out the solution as follows:
First add the function to be called to a action
add_action(‘some_action’,’my_function’);
some_action can be replaced with any random name for an action you can think of.
Then schedule the action:
wp_schedule_event(time(), ‘hourly’, ‘some_action’);
The key is to schedule actions not functions.