I'm trying to find out how much gas is required for a transaction to complete in about 5-10 seconds. Is there any way to do that, or is my understanding of this wrong?
Thanks in advance!
The gas limit (amount of gas) doesn't affect how long a transaction takes to be mined. The gas price does. https://ethgasstation.info/ is a good resource for seeing what gas prices are currently getting transactions mined in what timeframes.
That said "5-10 seconds" is impossible, because new blocks are only created in Ethereum every 12-15 seconds, and it's generally too late to get a transaction into the block miners are already working on, so you need to expect a minimum of more like 20-30 seconds no matter how high a gas price you specify.