new跟不new的时间距离
来源:互联网 发布:js二维数组转json对象 编辑:程序博客网 时间:2024/04/29 11:16
/******************************************************************** file name : new.h author : Clark/陈泽丹 created : 2011-11-29 *********************************************************************/ #include <iostream>#include <Windows.h>using namespace std;void test1(){int* p = new int;delete p;p = NULL;}void test2(){int p;}void main(){int s, e;s = GetTickCount();for(int i=0; i<10000; i++)test2();e = GetTickCount();cout<<"test2 cost: "<<e-s<<endl;s = GetTickCount();for(int i=0; i<10000; i++)test1();e = GetTickCount();cout<<"test1 cost: "<<e-s<<endl;system("pause");}
test2 cost: 0
test1 cost: 32
请按任意键继续. . .
- new跟不new的时间距离
- C#new与不new的差别
- go语言 的 new 和不new
- malloc/free 跟new/delete的区别
- malloc/free 跟new/delete的区别
- 不加new的初始化
- malloc跟new
- new static 跟 new self 区别
- 创建类的时候使用new和不使用new
- C++之创建对象时的new与不new
- C++之创建对象时的new与不new
- C++创建对象,new与不new的区别
- c++ new和不new对象的区别
- C++中new和不new的区别
- Java中new和不new的区别
- new Date(时间) 加L和不加L是有非常大的不同的
- C++new 和不new的区别,java引用数据类型必须new
- new Date() 输出来的时间不正确
- distinct去掉mysql中重复字段值
- Python fnmatch — Unix filename pattern matching
- Drupal的交互性
- 项目管理小故事之小矮人的故事
- 使用HTML5进行地理位置定位
- new跟不new的时间距离
- CrashReporter
- drupal6 常用 .gitignore 配置
- asp.net下载,支持中文名,断点续传,控制单线程下载速度
- 操作系统实验七——模拟虚拟存储管理(下)
- 终端下定位到drupal根目录的命令
- 项目管理小故事之三只老鼠的“偷油”项目为什么失败
- DrupalChina.org打不开了,我们到哪里去交流?
- C和C++函数的相互引用 extern "c"深入理解