I am curious if BitCoin transfers can occur in real-time. The example I am thinking of is much like paying for coffee at Starbucks using a QR code on your smartphone. The 2D/3D barcode reader is able to scan the QR code, which deducts the amount from your account. In BitCoin terms, your wallet address would send payment to the Starbucks wallet address.
Can BitCoin transactions be confirmed in real-time? If not, how long does it take? Why does charging a transaction fee change the time?