2015年5月8日
摘要: 1 // singleton.h 2 3 #ifndef SINGLETON_H 4 #define SINGLETON_H 5 6 // 单例基类模板 7 template 8 class Singleton 9 {10 public:11 static T& give_me()1... 阅读全文
posted @ 2015-05-08 23:00 独孤酷酷 阅读(286) 评论(0) 推荐(0) 编辑
摘要: struct timeval{ long int tv_sec; // 秒数 同time(NULL) 的返回值 long int tv_usec; // 微秒数 10 的6次方 }; 1 struct timezone{ 2 int tz_minuteswest;/*格林威治时间往西方的时差*/ 3 int tz_dsttime;/*DST 时间的修... 阅读全文
posted @ 2015-05-08 22:53 独孤酷酷 阅读(2970) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 #pragma comment( lib,"winmm.lib" ) 5 6 int main() 7 { 8 DWORD msec = timeGetTime(); 9 std::cout << "msec = " << msec << std::endl; 10 11 return 0... 阅读全文
posted @ 2015-05-08 22:38 独孤酷酷 阅读(3654) 评论(0) 推荐(0) 编辑
摘要: ftime() 函数,这个函数是取系统的时间,精确到毫秒级别,它在windows 和linux 下都可用。所以我暂时是比较喜欢它的。 这个函数返回一个结构体,结构体中两个成员,其中time 成员,与函数 time(NULL) 返回的是等同的,用它可以配合localtime mktime ctime 阅读全文
posted @ 2015-05-08 22:36 独孤酷酷 阅读(5354) 评论(0) 推荐(0) 编辑