About 6 months ago, I had the explosives detector at SFO flag me as suspect after a random pat-down. What followed was a second, slightly more thorough, pat-down and a very thorough search of my carry-on. It all took about 15 minutes, and the TSA staff were nothing but friendly throughout the procedure.
Whenever you fly, keep two things in mind: 1) the TSA staff are mostly just doing their job, and 2) not all of them are assholes.