I want to add a processing time middleware to my ASP.NET Core WebApi like this
public class ProcessingTimeMiddleware
{
private readonly RequestDelegate
On a related note, without answering your question as such, there is now a Server-Timing
specification, a standard header to provide durations, amongst other metrics. This should allow you to use
Server-Timing: processingTime;dur=12ms
You can find the specification at https://www.w3.org/TR/server-timing/