Welcome!
Well, one question begets others. Apple does not publish the port power, and other sources are in varying units, such as watts v. milli-amps. An iMacUSB 3 port can provide up to 900mA.
Are you using the USB3 or the Thunderbolt ports on the iMac to charge?
The current small-format Apple charging bricks are now up to 20W, and the Apple Store still lists 5W, 12W, and up to a 30-watt brick that are all compatible with most newer iPhones, so this depends on which iPhone model you have as well.
We have several iPads but no iPhones. I've not noticed enough difference in charge time between using one of our Macs or wall power to think to time the charge cycle. However, I have noticed charge time differences among the rather embarrassing collection of charging cables we've accumulated since getting iPads 10 years ago. Apple cables seem to charge faster and stay cooler than the off-brand stuff.
Awaiting your followup info...
AJ