Perf.cs
上传用户:hbhltzc
上传日期:2022-06-04
资源大小:1925k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

Visual C++

  1. //------------------------------------------------------------------------------
  2. // <copyright file="Perf.cs" company="Microsoft">
  3. //     Copyright (c) Microsoft Corporation.  All rights reserved.
  4. // </copyright>                                                                
  5. //------------------------------------------------------------------------------
  6. #define MEASURE_PERF
  7. namespace Microsoft.XmlDiffPatch {
  8. #if MEASURE_PERF
  9.     public class XmlDiffPerf 
  10.     {
  11.         public int _loadTime = 0;
  12.         public int _hashValueComputeTime = 0;
  13.         public int _identicalOrNoDiffWriterTime = 0;
  14.         public int _matchTime = 0;
  15.         public int _preprocessTime = 0;
  16.         public int _treeDistanceTime = 0;
  17.         public int _diffgramGenerationTime = 0;
  18.         public int _diffgramSaveTime = 0;
  19.         public int TotalTime { 
  20.             get { 
  21.                 return _loadTime + _hashValueComputeTime + _identicalOrNoDiffWriterTime + _matchTime + _preprocessTime +
  22.                     _treeDistanceTime + _diffgramGenerationTime + _diffgramSaveTime; 
  23.             } 
  24.         }
  25.         public void Clean() 
  26.         {
  27.             _loadTime = 0;
  28.             _hashValueComputeTime = 0;
  29.             _identicalOrNoDiffWriterTime = 0;
  30.             _matchTime = 0;
  31.             _preprocessTime = 0;
  32.             _treeDistanceTime = 0;
  33.             _diffgramGenerationTime = 0;
  34.             _diffgramSaveTime = 0;
  35.         }
  36.     }
  37. #endif
  38. }