예제 #1
0
 private void dumpInfo()
 {
     if (CPUPerf.PerfNameMap == null)
     {
         return;
     }
     foreach (FuncInfo current in CPUPerf.PerfNameMap.Values)
     {
         if (current.callCount > 0)
         {
             double num  = (double)current.total * this.mRadix;
             double num2 = (double)current.maxTime * this.mRadix;
             double num3 = num / (double)current.callCount;
             this.addCell(current.name);
             this.addCell(current.callCount);
             this.addCell(num);
             this.addCell(num / this.mSpendTime * 100.0);
             this.addCell(num3);
             this.addCell(num2);
             CPUPerf.writeLine();
             current.callCount = 0;
             current.total     = 0L;
             current.maxTime   = 0L;
         }
     }
 }
예제 #2
0
 public static void Error(string printOut)
 {
     try
     {
         CPUPerf.mCacheString.Append(printOut);
         CPUPerf.writeLine();
         CPUPerf.mPerfFile.Flush();
     }
     catch (Exception var_0_20)
     {
     }
 }
예제 #3
0
 private void Update()
 {
     if (++this.mFrameCnt >= this.mUpdateInterval)
     {
         long num = this.mCPUTime;
         this.mCPUTime   = Stopwatch.GetTimestamp();
         this.mSpendTime = (double)(this.mCPUTime - num) * this.mRadix;
         double num2 = (double)(this.mFrameCnt * 1000) / this.mSpendTime;
         this.mTotalTime += this.mSpendTime;
         this.mFrameCnt   = 0;
         if (num2 < (double)this.mDumpFPSLimit)
         {
             CPUPerf.ForcePrint = false;
             try
             {
                 CPUPerf.writeLine();
                 CPUPerf.mCacheString.Append("FPS:");
                 CPUPerf.mCacheString.Append((float)num2);
                 CPUPerf.mCacheString.Append(" | ");
                 CPUPerf.mCacheString.Append(this.mUpdateInterval);
                 CPUPerf.mCacheString.Append(" frame spend time about(ms): ");
                 CPUPerf.mCacheString.Append((float)this.mSpendTime);
                 CPUPerf.mCacheString.Append(" | cur time(s): ");
                 CPUPerf.mCacheString.Append((float)(this.mTotalTime / 1000.0));
                 CPUPerf.writeLine();
                 this.dumpInfo();
                 CPUPerf.mPerfFile.Flush();
             }
             catch (Exception var_2_133)
             {
             }
         }
         if (CPUPerf.PerfNameMap != null)
         {
             foreach (FuncInfo current in CPUPerf.PerfNameMap.Values)
             {
                 current.callCount = 0;
                 current.total     = 0L;
                 current.maxTime   = 0L;
             }
         }
     }
 }