---
title: "Get timings for an HTTP metric | Grafana k6 documentation"
description: "How to calculate timings for an individual k6 metric"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Get timings for an HTTP metric

To access the timing information from an individual HTTP request, the [Response.timings](/docs/k6/latest/javascript-api/k6-http/response/) object provides the time spent on the various phases in `ms`. One use case of this is to use the timings in a [Custom metric](/docs/k6/latest/using-k6/metrics/create-custom-metrics/) to make a trend for a specific endpoint.

The timings are as follows:

- blocked: equals to `http_req_blocked`.
- connecting: equals to `http_req_connecting`.
- tls\_handshaking: equals to `http_req_tls_handshaking`.
- sending: equals to `http_req_sending`.
- waiting: equals to `http_req_waiting`.
- receiving: equals to `http_req_receiving`.
- duration: equals to `http_req_duration`.

This script gets the request duration timing for a specific GET request and logs it to the console.

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import http from 'k6/http';

export default function () {
  const res = http.get('https://quickpizza.grafana.com/');
  console.log('Response time was ' + String(res.timings.duration) + ' ms');
}
```

The expected (partial) output looks like this:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
$ k6 run script.js

  INFO[0001] Response time was 337.962473 ms               source=console
```
