예제 #1
0
파일: IndexResult.cs 프로젝트: neozhu/MrCMS
 public static IndexResult GetResult(Action action)
 {
     var stopwatch = Stopwatch.StartNew();
     var indexResult = new IndexResult();
     try
     {
         action();
     }
     catch (Exception ex)
     {
         indexResult.AddError(ex.Message);
     }
     stopwatch.Stop();
     indexResult.ExecutionTime = stopwatch.ElapsedMilliseconds;
     return indexResult;
 }
예제 #2
0
        public static IndexResult GetResult(Action action)
        {
            var stopwatch   = Stopwatch.StartNew();
            var indexResult = new IndexResult();

            try
            {
                action();
            }
            catch (Exception ex)
            {
                indexResult.AddError(ex.Message);
            }
            stopwatch.Stop();
            indexResult.ExecutionTime = stopwatch.ElapsedMilliseconds;
            return(indexResult);
        }