GetTickCount() 的另一种实现方法

在C++中,有时候,如果使用了标准命令空间 using namespace std;

就不能包含 <window.h> 这个头文件,但是, GetTickCount() 这个函数就必须包含这个头文件,那么,有没有什么方法可以实现呢?

 

可以这样写:

#include <time.h>
static unsigned long GetTickCount(void)
{
	return (unsigned long)time(NULL);
}

参考: https://blog.csdn.net/natpan/article/details/81292869

posted on 2020-12-21 11:26  lizhuohui  阅读(114)  评论(0编辑  收藏  举报

导航