为什么已经包含了mmsystem.h后timeGetTime还是未定义
2015-07-23
展开全部
timeGetTime取系统运行间
#include <stdio.h>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
#define ONE_HOUR 3600000 // 1,等于3600000毫秒
#define ONE_MINUTE 60000 // 1钟,等于60000毫秒
#define ONE_SECOND 1000 // 1秒钟,等于1000毫秒
void main()
{
dword dwTime = ::timeGetTime();
int nHour, nMinute, nSecond;
nHour = dwTime / ONE_HOUR;
if(nHour >= 1)
dwTime -= nHour * ONE_HOUR;
nMinute = dwTime / ONE_MINUTE;
if(nMinute >= 1)
dwTime -= nMinute * ONE_MINUTE;
nSecond = dwTime / ONE_SECOND;
printf("系统已经运行: %d%d钟%d秒\n", nHour, nMinute, nSecond);
}
#include <stdio.h>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
#define ONE_HOUR 3600000 // 1,等于3600000毫秒
#define ONE_MINUTE 60000 // 1钟,等于60000毫秒
#define ONE_SECOND 1000 // 1秒钟,等于1000毫秒
void main()
{
dword dwTime = ::timeGetTime();
int nHour, nMinute, nSecond;
nHour = dwTime / ONE_HOUR;
if(nHour >= 1)
dwTime -= nHour * ONE_HOUR;
nMinute = dwTime / ONE_MINUTE;
if(nMinute >= 1)
dwTime -= nMinute * ONE_MINUTE;
nSecond = dwTime / ONE_SECOND;
printf("系统已经运行: %d%d钟%d秒\n", nHour, nMinute, nSecond);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询