How do I write a callback function that will get called at a rate that I can define?