
编程语言
文章平均质量分 69
zp_mouse
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
用c++构造自己的log类
实现一个自动化框架需要打印log,面临着实现debug函数的功能,需求类似如下:Log::debug( "刘小明的身高是%d,他的姐姐叫%s,他家的狗体重%f" , 24, "Hellen", 32.5 ); 实现代码如下:#include void Log::debug( const char* msg, ... ){ va_list arg_ptr;原创 2010-04-29 12:33:00 · 478 阅读 · 0 评论 -
用c++实现记录程序运行时间的类
有时候性能测试需要统计qps,rt等参数, 我们可以在代码中加入时间戳来捕获一些请求所消耗的时间,如下就是我写的一个简单的Timer类:#includeclass Timer{ struct timeval begin_t, end_t; public: void set(); double get();//returns the millisec原创 2010-04-29 12:48:00 · 486 阅读 · 0 评论