using System;

namespace TestCSharp
{
class MainClass
{
public class t1 {
public b1 b = new b1();
} public class b1 {
public t2 t = new t2();
} public class t2 {
public b2 b = new b2();
} public class b2 {
public t3 t = new t3();
} public class t3 {
public b3 b = new b3();
} public class b3 {
public t4 t = new t4();
} public class t4 {
public b4 b = new b4();
} public class b4 {
public t5 t = new t5();
} public class t5 {
public b5 b = new b5();
} public class b5 {
public t6 t = new t6();
} public class t6 {
public b6 b = new b6();
} public class b6 {
public int x = ;
} public static int stimes = ; public static void Main (string[] args)
{
int times = stimes;
t1 test1 = new t1();
DateTime s1 = DateTime.Now;
for (int i = ; i < times; i++)
{
test1.b.t.b.t.b.t.b.t.b.t.b.x ++;
}
DateTime e1 = DateTime.Now;
Console.WriteLine("time1 = " + (e1 - s1).Milliseconds); t1 test2 = new t1();
DateTime s2 = DateTime.Now;
b6 b2 = test2.b.t.b.t.b.t.b.t.b.t.b;
for (int i = ; i < times; i++)
{
b2.x ++;
}
DateTime e2 = DateTime.Now;
Console.WriteLine("time2 = " + (e2 - s2).Milliseconds); t1 test3 = new t1();
DateTime s3 = DateTime.Now;
b6 b3 = test3.b.t.b.t.b.t.b.t.b.t.b;
for (int i = ; i < times; i++)
{
b3.x = b3.x + ;
}
DateTime e3 = DateTime.Now;
Console.WriteLine("time3 = " + (e3 - s3).Milliseconds); t1 test4 = new t1();
DateTime s4 = DateTime.Now;
b6 b4 = test4.b.t.b.t.b.t.b.t.b.t.b;
for (int i = ; i < stimes; i++)
{
b4.x = b4.x + ;
}
DateTime e4 = DateTime.Now;
Console.WriteLine("time4 = " + (e4 - s4).Milliseconds); t1 test5 = new t1();
DateTime s5 = DateTime.Now;
b6 b5 = test5.b.t.b.t.b.t.b.t.b.t.b;
for (int i = ; i < ; i++)
{
b5.x = b5.x + ;
}
DateTime e5 = DateTime.Now;
Console.WriteLine("time5 = " + (e5 - s5).Milliseconds);
} }
}

output:

time1 = 456
time2 = 144
time3 = 145
time4 = 145
time5 = 179
请按任意键继续. . .

总结: 缓存一下总是有好处的

最新文章

  1. Python数据结构与算法设计总结篇
  2. 在CTabCtrl上动态创建CListCtrl控件
  3. socket编写简单回显server
  4. 解决ssh或ftp下root用户认证失败问题
  5. Linux变量内容的删除、取代与替换
  6. .NET开发微信小程序-Template模块开发
  7. JS 超类和子类
  8. js 连接mqtt
  9. Python学习之MacBook Pro中Python3.7安装pip以及numpy
  10. spring boot+mybatis+generator生成domain大小写问题
  11. jquery的设计亮点
  12. PAT A1132 Cut Integer (20 分)——数学题
  13. linux如何删除行首的空格
  14. i2c驱动笔记
  15. “Hello World!”团队第六周的第二次会议
  16. HTML5页面CSS Reset
  17. include和application
  18. P1297 网线切割
  19. linux fg bg ctrl + z jobs &amp; 等命令
  20. ACM学习历程—51NOD1028 大数乘法V2(FFT)

热门文章

  1. &quot;Could not resolve host: mirrorlist.centos.org; Unknown error&quot;解决方法
  2. SpringBoot之封装json对象返回json数据
  3. BitmapFactory之Options
  4. ELK之elasticsearch删除索引
  5. 【Kail 学习笔记】自用KAIL更新源
  6. 最新 字节跳动java校招面经 (含整理过的面试题大全)
  7. css中盒子模型与box-sizing属性
  8. GitLab基本使用
  9. 逆转单向链表看这一篇就够了【JAVA】
  10. Yii错误异常处理