Speaking to reporters, Trump said the situation was "right on the borderline" and could escalate quickly.
Six weeks after he paused Operation Epic Fury for a ceasefire, talks to end the war have shown little progress, while soaring petrol prices have weighed on the president's approval ratings.
"Believe me, if we don't get the right answers, it goes very quickly. We're all ready to go," he said at Joint Base Andrews near Washington DC.
Asked how long he would wait, Trump said, "It could be a few days, but it could go very quickly."
Iran warned against renewed attacks. "If aggression against Iran is repeated, the promised regional war will extend beyond the region this time," the Revolutionary Guards said in a statement.
Tehran also launched a new Persian Gulf Strait Authority to control traffic in the critical Strait of Hormuz waterway.
Trump reiterated his determination not to allow Iran to acquire a nuclear weapon.
"We're in the final stages of Iran. We'll see what happens. Either have a deal or we're going to do some things that are a little bit nasty, but hopefully that won't happen," Trump told reporters earlier on Wednesday, US time.
"Ideally I'd like to see few people killed, as opposed to a lot. We can do it either way."
He spoke with Turkish President Tayyip Erdogan, who welcomed the extension of the ceasefire and told Trump he thought a "reasonable solution" was possible, Ankara said.
Parliament Speaker Mohammad Baqer Qalibaf, Iran's top peace negotiator, said in an audio message on social media that "obvious and hidden moves by the enemy" showed the Americans were preparing new attacks.
Iranian President Masoud Pezeshkian said Tehran remained open to negotiations, but added in a post on social media platform X, "forcing Iran to surrender through coercion is nothing but an illusion".
Foreign ministry spokesman Esmaeil Baghaei said Iran was pursuing negotiations "with seriousness and good faith, but it has strong and reasonable suspicion over America's performance".
In the latest diplomatic push, the interior minister of Pakistan - which hosted the only round of peace talks so far and has since been the conduit for messages between the sides - was in Tehran on Wednesday.
Baghaei said Washington and Tehran continued to exchange messages through the Pakistani minister's mediation.
Iran submitted a new offer to the US this week. Tehran's descriptions suggest it largely repeats terms previously rejected by Trump, including demands for control of the Strait of Hormuz, compensation for war damage, lifting of sanctions, release of frozen assets and the withdrawal of US troops.
Trump on Tuesday said he had been an hour away from ordering attacks this week in response to requests from several of Iran's Gulf neighbours.
Iran has largely shut the Strait of Hormuz to all ships apart from its own since the US-Israeli attacks began on February 28, causing the biggest disruption to global energy supplies in history.
US Treasury Secretary Scott Bessent told Reuters on Tuesday he viewed elevated yields and headline inflation as "transient" and said they will subside when the conflict ends.
"The strait will open, and we'll normalise energy prices," he said.
Shipping monitor Lloyd's List said at least 54 ships had transited the strait last week, about double the previous week. Iran said 26 ships had crossed in the past 24 hours, still only a fraction of the 140 per day before the war.