jeudi 21 janvier 2016

How to get time to first byte with HttpClient class c#

Here's the code I am currently using to make calls to the api, where api is a string passed into the function. Set up of the httpClient is done beforehand outside of the method.

HttpResponseMessage response = await httpClient.GetAsync(api);
String strResp = await response.Content.ReadAsStringAsync();

httpClient.DefaultRequestHeaders.Accept.Clear();

Is there a way I can track metrics like time to first byte (TTFB) using this code, or will I have to go another route?

Aucun commentaire:

Enregistrer un commentaire