When you cross an international border, routine stops and searches fall under the "border exception" to the Fourth Amendment. You can be detained long enough for immigration authorities to verify that you are not bringing impermissible items into the United States. Routine searches upon entry to a nation require no probable cause.

More thorough searches require only reasonable suspicion - a relatively easy standard to meet. Once the suspicion is resolved in your favor, if no contraband is found you are to be released.

The questions in your case would be whether there was reasonable basis for the search (we can't answer that) and whether the duration of your detention was excessive to resolve the question of whether you were smuggling contraband (depending on how much stuff you had in your vehicle and the nature of the search conducted, an hour could be reasonable or it could be excessive).

If immigration officers had reasonable suspicion to support the search, arguing that they could have completed the search in thirty minutes instead of an hour isn't likely to get you very far. Immigration officials are not responsible for your speeding ticket.