I wonder if `wait(ms, [timeoutFn])` might be a more intuitive interface.