public void ResolveInterceptors() { var fileName = @"..\..\..\ResolveInterceptors.txt"; File.WriteAllText(fileName, ""); var serviceProvider = new ServiceCollection().BuildServiceProvider(); var collector = new InterceptorCollector(new InterceptorChainBuilder(serviceProvider)); var sw = Stopwatch.StartNew(); collector.GetInterceptors(typeof(Demo)); File.AppendAllLines(fileName, new string[] { sw.Elapsed.ToString() }); sw.Restart(); collector.GetInterceptors(typeof(Demo)); File.AppendAllLines(fileName, new string[] { sw.Elapsed.ToString() }); sw.Restart(); collector.GetInterceptors(typeof(Demo)); File.AppendAllLines(fileName, new string[] { sw.Elapsed.ToString() }); Console.WriteLine(sw.Elapsed); }