Exemplo n.º 1
0
        public ActionResult Index()
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();
            DemoMethods methods = new DemoMethods();
            var         content = methods.Content();
            var         count   = methods.Count();
            var         name    = methods.Name();

            watch.Stop();
            ViewBag.WatchMilliseconds = watch.ElapsedMilliseconds;
            return(View());
        }
Exemplo n.º 2
0
        public async Task <ActionResult> IndexAsync()
        {
            Stopwatch   watch   = new Stopwatch();
            DemoMethods methods = new DemoMethods();

            watch.Start();
            var contentTask = methods.ContentAsync();
            var countTask   = methods.CountAsync();
            var nameTask    = methods.NameAsync();

            var content = await contentTask;
            var count   = await countTask;
            var name    = await nameTask;

            watch.Stop();
            ViewBag.WatchMilliseconds = watch.ElapsedMilliseconds;
            return(View("Index"));
        }
Exemplo n.º 3
0
 public void Init()
 {
     _demoClass = LogInterceptorFactory.Create <DemoMethods>(null, m => m.Name.Contains("D"), LoggerType.ClientInteraction);
 }