예제 #1
0
        static public void      ResetAll()
        {
            ArrayList newSections = new ArrayList();

            foreach (WeakReference wr in s_sections)
            {
                if (wr.IsAlive)
                {
                    ProfilingSection ps = (ProfilingSection)wr.Target;
                    ps.Reset();
                    newSections.Add(wr);
                }
            }
            s_sections = newSections;
        }
예제 #2
0
        static public string GetStatsString()
        {
            System.GC.Collect();

            StringWriter sw = new StringWriter();

            sw.WriteLine("ProfilingSection Statistics");
            string    prefix      = "\t";
            ArrayList newSections = new ArrayList();

            foreach (WeakReference wr in s_sections)
            {
                if (wr.IsAlive)
                {
                    ProfilingSection ps = (ProfilingSection)wr.Target;
                    sw.WriteLine(prefix + ps.ToString());
                    newSections.Add(wr);
                }
            }
            s_sections = newSections;
            return(sw.ToString());
        }