I think you need the function in the class to set a timer and then return, when the timer calls the function back d what the function needs to do and either call back the calling thread or raise an event.