Created DelayedTask class which lets an action be executed at a later time.