コード例 #1
0
        public long Index()
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();
            ContentManagement service = new ContentManagement();
            var content = service.GetContent();
            var count   = service.GetCount();
            var name    = service.GetName();

            watch.Stop();
            return(watch.ElapsedMilliseconds);
        }
コード例 #2
0
        public async Task <long> 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();
            return(watch.ElapsedMilliseconds);
        }