Implementation of an homemade timer to schedule timeouts