It all depends on what type of card it is debit or credit , the issuer Maestro Visa Delta etc. and how the transaction is handled Pin or by signing a paper slip.
When I buy my weekly groceries using pin or use a cash machine the transaction is there online when I get home. Before chip and pin it took 2 days to be debited.