you may want to read this discussion on ROBOTC tasks, however, I need to fix the links in that post, forum upgrade broke everything.
also, here’s some code I posted last week.