A: private void DateDiff(DateTime t1, DateTime t2)
{
System.Double bt= 0;
TimeSpan nt= t1.Subtract(t2);
bt= Math.Round(nt.Minutes, 0);
return bt;
}问题是这样的:
B:
private void DateDiff(DateTime t1, DateTime t2)
{
TimeSpan nt= t1.Subtract(t2);
return Math.Round(nt.Minutes, 0);
}
是不是比A代码要效率更高.如果这个要执行很多次的话,是不是B要更加快,A要花更多内存?
高手请指点
{
System.Double bt= 0;
TimeSpan nt= t1.Subtract(t2);
bt= Math.Round(nt.Minutes, 0);
return bt;
}问题是这样的:
B:
private void DateDiff(DateTime t1, DateTime t2)
{
TimeSpan nt= t1.Subtract(t2);
return Math.Round(nt.Minutes, 0);
}
是不是比A代码要效率更高.如果这个要执行很多次的话,是不是B要更加快,A要花更多内存?
高手请指点
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货