关于获取系统用户时间和内核时间的有关问题
关于获取系统用户时间和内核时间的问题
GetSystemTimes这个API是用来获取系统的空闲时间 用户时间和内核时间,但是最近发现在windows XP Home Edition系统下不能运行程序,原因就是这个API不能使用,大家有什么其他的方法来获取系统的用户时间和内核时间吗?
------解决方案--------------------
#include<ctime>
using namespace std;
time_t now_time;
now_time = time(NULL);
------解决方案--------------------
COleDateTime dateTest;
// dateTest value = midnight 30 December 1899
dateTest = COleDateTime::GetCurrentTime();
------解决方案--------------------
NtQuerySystemInformation
GetSystemTimes这个API是用来获取系统的空闲时间 用户时间和内核时间,但是最近发现在windows XP Home Edition系统下不能运行程序,原因就是这个API不能使用,大家有什么其他的方法来获取系统的用户时间和内核时间吗?
内核
------解决方案--------------------
#include<ctime>
using namespace std;
time_t now_time;
now_time = time(NULL);
------解决方案--------------------
COleDateTime dateTest;
// dateTest value = midnight 30 December 1899
dateTest = COleDateTime::GetCurrentTime();
------解决方案--------------------
NtQuerySystemInformation