protected override double doGetAccumulatedTimeHiResolution(rcTimerLabel label) { if (!Stopwatch.IsHighResolution) { return(-1.0); } if (m_Stopwatches[(int)label].IsRunning) { UnityEngine.Debug.LogError("Stopwatch " + label.ToString() + " was not stopped prior to output"); } double seconds = (double)m_Stopwatches[(int)label].ElapsedTicks / (double)Stopwatch.Frequency; return(seconds * 1000.0); }
private void logLine(rcTimerLabel label, string name, double pc, int level = 0) { double t = getAccumulatedTimeHiResolution(label); if (t <= 0.0f) { return; } string raster = ""; if (level > 0) { raster += new string(' ', 4 * level); } raster += name + ": "; if (raster.Length < 25) { raster += new string(' ', 25 - raster.Length); } int secondColumn = 40; if (level != 0) { raster += "<color=grey>"; secondColumn += 12; } raster += string.Format("{0:N2}", t) + "ms "; if (raster.Length < secondColumn) { raster += new string(' ', secondColumn - raster.Length); } raster += "(" + string.Format("{0:N1}", t * pc) + "%)"; if (level != 0) { raster += "</color>"; } log(rcLogCategory.RC_LOG_PROGRESS, raster); m_PercentCheck += t * pc; m_SumCheck += t; }
protected override long doGetAccumulatedTime(rcTimerLabel label) { return(m_Stopwatches[(int)label].ElapsedMilliseconds); }
protected override void doStopTimer(rcTimerLabel label) { m_Stopwatches[(int)label].Stop(); }
protected override double doGetAccumulatedTimeHiResolution(rcTimerLabel label) { if (!Stopwatch.IsHighResolution) { return -1.0; } if (m_Stopwatches[(int)label].IsRunning) { UnityEngine.Debug.LogError("Stopwatch " + label.ToString() + " was not stopped prior to output"); } double seconds = (double)m_Stopwatches[(int)label].ElapsedTicks / (double)Stopwatch.Frequency; return seconds * 1000.0; }
protected override long doGetAccumulatedTime(rcTimerLabel label) { return m_Stopwatches[(int)label].ElapsedMilliseconds; }
private void logLine(rcTimerLabel label, string name, double pc, int level = 0) { double t = getAccumulatedTimeHiResolution(label); if (t <= 0.0f) return; string raster = ""; if (level > 0) { raster += new string(' ', 4*level); } raster += name + ": "; if (raster.Length < 25) { raster += new string(' ', 25 - raster.Length); } int secondColumn = 40; if (level != 0) { raster += "<color=grey>"; secondColumn += 12; } raster += string.Format("{0:N2}", t) + "ms "; if (raster.Length < secondColumn) { raster += new string(' ', secondColumn - raster.Length); } raster += "(" + string.Format("{0:N1}", t * pc) + "%)"; if (level != 0) { raster += "</color>"; } log(rcLogCategory.RC_LOG_PROGRESS, raster); m_PercentCheck += t * pc; m_SumCheck += t; }