From 5803ae7f1187ccae683acd4a7c7b48bc9c42c9d1 Mon Sep 17 00:00:00 2001 From: Christian Noon Date: Sun, 7 Feb 2016 14:46:34 -0800 Subject: [PATCH] Added a Timeline section to the README. --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 83c6318..9f4a6af 100644 --- a/README.md +++ b/README.md @@ -572,6 +572,25 @@ Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) } ``` +### Timeline + +Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`. + +```swift +Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) + .validate() + .responseJSON { response in + print(response.timeline) + } +``` + +The above reports the following `Timeline` info: + +- `Latency`: 0.428 seconds +- `Request Duration`: 0.428 seconds +- `Serialization Duration`: 0.001 seconds +- `Total Duration`: 0.429 seconds + ### Printable ```swift -- GitLab