public async Task <ActionResult> IndexAsync() { Stopwatch watch = new Stopwatch(); watch.Start(); ContentManagement service = new ContentManagement(); var contentTask = service.GetContentAsync(); var numberTask = service.GetNumbreAsync(); await contentTask; await numberTask; watch.Stop(); ViewBag.Milliseconds = watch.ElapsedMilliseconds; return(View()); }
public async Task <ActionResult> IndexAsync() { Stopwatch watch = new Stopwatch(); watch.Start(); ContentManagement service = new ContentManagement(); var contentTask = service.GetContentAsync(); var countTask = service.GetCountAsync(); var nameTask = service.GetNameAsync(); var content = await contentTask; var count = await countTask; var name = await nameTask; watch.Stop(); ViewBag.WatchMilliseconds = watch.ElapsedMilliseconds; return(View("Index")); }