Page 1 of 1

Timing chart performance?

Posted: Wed Jul 12, 2006 5:17 pm
by 8128589
I'm trying to measure the performance of various chart configurations. To measure drawing time, I start a timer in the "BeforeDraw" event and stop it in "AfterDraw".

Is this a valid way to measure chart drawing time?

Posted: Thu Jul 13, 2006 10:32 am
by narcis
Hi Gp,

Yes, you could do something like this:

Code: Select all

		private DateTime startTime, now;

		private void tChart1_BeforeDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			startTime = DateTime.Now;		
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			//calculate elapsed time         
			now = DateTime.Now;
			TimeSpan elapsedTime = new TimeSpan(now.Ticks - startTime.Ticks);
			int total = (elapsedTime.Seconds * 1000) + elapsedTime.Milliseconds;
			
			label1.Text="Elapsed time: " + total.ToString() + " ms";	
 	  }

Posted: Thu Jul 13, 2006 4:38 pm
by 8128589
Thanks, that's pretty much what I'm doing!