allow timeout to be specified as a duration