An Optimal Exit Time Problem