Ridesharing Using Adaptive Waiting Time