Tosfot asks the obvious question, what possible curse can one say in such a split second? One of his answers is that as long as he started in that one split second, he can continue on after the split second is over.
The answer I liked was that Biaam would say Kaleim (kuf, lamed, mem), which means cursed. Someone in the shiur said that there is a Tosfot in Avoda Zara that says that if you take the word kaleim and reverse it, it spells Melech. Since the Jews were showing loyalty to the Melech, i.e. Hashem, Bilaams curse was unable to be fulfilled.
Also, if you look at Ashrei, which we say three times daily, we have three pesukim in a row:
Kvod Malchutcha Yomairu Ugvurascha Yedabeiru
L'hodia livnei adam gvuratam, u'chvod hadar malchutcha
Malchutcha malchut kol olamim u'memshalticha bchol dor v'dor
These three pesukim which are all in a row start with the letters kuf, lamed, and mem, which spell Kaleim, cursed. But note that each pasuk also talks about Malchut. It's the acceptance of the Malchut, of Hashem, that has the power to REVERSE the curse, and make it from Kaleim, to Melech.