It doesn't take long. I just bought (today) a 2017 Access cab TRD Sport V6 Manual. I did my research yesterday, found what I wanted and best price online at a dealer 100 miles away, went to a local dealer with that price and asked if they wanted to meet it. They did (of course they say that, but ...with a little reluctance on their part they really did). My configuration was not in their stock so they found the same configuration, color .. everything at another dealer 35 miles away, traded it for one off theirs and in 4 hours had the truck ready at their door.. Perfect. Even got them to throw in some door protectors, tow hitch and third year maintenance.
1) know exactly what you are looking for and stick to it. Doesn't matter if they have it in stock - they can get it from another dealer if they want.
2) know what you are prepared to pay and show comparative quotes (online makes it dead easy).
3) be prepared to walk away. You won't have to, but project that subtly with things like "I'll just keep looking around" etc.