/// <summary> /// Create a Profiler /// </summary> /// <param name="name">The name of the profiler to draw with the bars</param> /// <param name="color">The color of the bar</param> /// <param name="parent">If this is a sub-profiler, give the parent Profiler. For top-level put "null"</param> public Profiler(String name, Color color, Profiler parent) { m_timer = new Stopwatch(); m_name = name; m_color = color; m_children = new LinkedList<Profiler>(); m_sample = new float[NUM_SAMPLE]; for (int i = 0; i < NUM_SAMPLE; ++i) m_sample[i] = 0.0f; m_curSample = 0; m_parent = parent; if (null != m_parent) m_parent.AddChild(this); }
/// <summary> /// Create a Profiler /// </summary> /// <param name="name">The name of the profiler to draw with the bars</param> /// <param name="color">The color of the bar</param> /// <param name="parent">If this is a sub-profiler, give the parent Profiler. For top-level put "null"</param> public Profiler(String name, Color color, Profiler parent) { m_timer = new Stopwatch(); m_name = name; m_color = color; m_children = new LinkedList <Profiler>(); m_sample = new float[NUM_SAMPLE]; for (int i = 0; i < NUM_SAMPLE; ++i) { m_sample[i] = 0.0f; } m_curSample = 0; m_parent = parent; if (null != m_parent) { m_parent.AddChild(this); } }