Fixing set_periodic example

The previous code was still using set_timer.