コード例 #1
0
ファイル: BuildContext.cs プロジェクト: zhu1987/rcdtcs
        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);
        }
コード例 #2
0
ファイル: BuildContext.cs プロジェクト: zhu1987/rcdtcs
        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;
        }
コード例 #3
0
ファイル: BuildContext.cs プロジェクト: zhu1987/rcdtcs
 protected override long doGetAccumulatedTime(rcTimerLabel label)
 {
     return(m_Stopwatches[(int)label].ElapsedMilliseconds);
 }
コード例 #4
0
ファイル: BuildContext.cs プロジェクト: zhu1987/rcdtcs
 protected override void doStopTimer(rcTimerLabel label)
 {
     m_Stopwatches[(int)label].Stop();
 }
コード例 #5
0
ファイル: BuildContext.cs プロジェクト: jlalleve/rcdtcs
        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;
        }
コード例 #6
0
ファイル: BuildContext.cs プロジェクト: jlalleve/rcdtcs
 protected override long doGetAccumulatedTime(rcTimerLabel label)
 {
     return m_Stopwatches[(int)label].ElapsedMilliseconds;
 }
コード例 #7
0
ファイル: BuildContext.cs プロジェクト: jlalleve/rcdtcs
        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;
        }
コード例 #8
0
ファイル: BuildContext.cs プロジェクト: jlalleve/rcdtcs
 protected override void doStopTimer(rcTimerLabel label)
 {
     m_Stopwatches[(int)label].Stop();
 }