谁能更快?为什么?C#代码优化
1:
Point point = new Point(25,25); //any numbers..
Point point2 = new Point(20,95); //any numbers..
Graphics g = CreateGraphics();
g.DrawLine(point,point2);
OR
2:
Graphics g = CreateGraphics();
g.DrawLine(new Point(25,25),new Point(20,95));
sugest你使用基准System.Diagnostics.StopWatch。问题对于更广泛的受众没有价值或没有价值... – 2009-06-15 00:41:53
我认为问题是有效的,不明白为什么downvotes! – 2009-06-15 00:41:55
这个问题是有效的,但毫无意义。它最好是微型优化,最好是最好。 – Eric 2009-06-15 00:43:06