Timing chart performance?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Gp
Newbie
Newbie
Posts: 43
Joined: Thu Jan 13, 2005 5:00 am

Timing chart performance?

Post by Gp » Wed Jul 12, 2006 5:17 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jul 13, 2006 10:32 am

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";	
 	  }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Gp
Newbie
Newbie
Posts: 43
Joined: Thu Jan 13, 2005 5:00 am

Post by Gp » Thu Jul 13, 2006 4:38 pm

Thanks, that's pretty much what I'm doing!

Post Reply