Added timer for AI functions