Latency is the time delay between a request and the response. It tells you how long it takes for data to travel through the system.
Key Points:
- Measured in: milliseconds (ms)
- Lower latency = faster response
- Common in networking, databases, APIs, etc.
Types of Latency:
| Type | Meaning |
|---|---|
| Network Latency | Time taken for data to travel over the network (client ↔ server) |
| Disk Latency | Time to read/write data from/to disk |
| Application Latency | Time taken by server logic to process a request |
| End-to-End Latency | Total time from user action → system response |
Example:
You click “Buy” on an e-commerce site → 500 ms later, the confirmation appears → Latency = 500 ms