using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FilterSamples.Filters
{
    public class SampleAsyncActionFilter : Attribute,IAsyncActionFilter
    {
        public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            DateTime dateTime = DateTime.Now;

            await next();

            double time = DateTime.Now.Subtract(dateTime).TotalMilliseconds;
        }
    }
}
