Add timeout function to loop object

Change-Id: I27c1445222bfedce8be75f714d6e5fe93adfe59e