关于WINCE时间获取?

ASHUI2002 2006-06-28 02:17:50
小弟我打算:在中断时开始定时再次中断时记录时间,有哪些好的API函数可调用?

在此先行谢过。
...全文
705 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
ASHUI2002 2006-07-04
  • 打赏
  • 举报
回复
再次向各位表示感谢
ASHUI2002 2006-06-30
  • 打赏
  • 举报
回复
GetTickCount();能达到什么精度?
singlerace 2006-06-30
  • 打赏
  • 举报
回复
Windows CE上能用winmm.lib?
flyprogrammer 2006-06-30
  • 打赏
  • 举报
回复
http://www.graphics.net.cn/bbs/vc/0059/308.asp
flyprogrammer 2006-06-30
  • 打赏
  • 举报
回复
一般用GetTickCount();
如果要获得更高精度的时间,可以采用winmm.lib库中的函数。
  • 打赏
  • 举报
回复

GetTickCount
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. To obtain the system timer resolution, use the GetSystemTimeAdjustment function.

DWORD GetTickCount(VOID);
Parameters
This function has no parameters.

Return Values
The return value is the number of milliseconds that have elapsed since the system was started.

Remarks
The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days.

If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.

Windows NT/2000/XP: To obtain the time elapsed since the computer was started, retrieve the System Up Time counter in the performance data in the registry key HKEY_PERFORMANCE_DATA. The value returned is an 8-byte value. For more information, see Performance Monitoring.

Example Code
The following example demonstrates how to handle timer wrap around.

DWORD dwStart = GetTickCount();

// Stop if this has taken too long
if( GetTickCount() - dwStart >= TIMELIMIT )
Cancel();
ASHUI2002 2006-06-30
  • 打赏
  • 举报
回复
有没有精度更高的呢?
yangdabao 2006-06-30
  • 打赏
  • 举报
回复
GetTickCount EVC支持吗??
zhoujie20153 2006-06-30
  • 打赏
  • 举报
回复
1ms
ASHUI2002 2006-06-28
  • 打赏
  • 举报
回复
向各位表示感谢
singlerace 2006-06-28
  • 打赏
  • 举报
回复
GetTickCount()精度比较差,如果你的系统实现了高分辨率计时器,可以用QueryPerformanceCounter()
zhoujie20153 2006-06-28
  • 打赏
  • 举报
回复
GetTickCount()
无聊客 2006-06-28
  • 打赏
  • 举报
回复
GetTickCount
leongwong 2006-06-28
  • 打赏
  • 举报
回复
http://www.cnemb.com/forum/simple/index.php?t11631.html
leongwong 2006-06-28
  • 打赏
  • 举报
回复
OEMGetRealTime是硬件厂商提供的时间

BOOL SetLocalTime(
const SYSTEMTIME *lpSystemTime
);

void GetLocalTime(
LPSYSTEMTIME lpSystemTime
);

试一试
leongwong 2006-06-28
  • 打赏
  • 举报
回复
up!关注!
ASHUI2002 2006-06-28
  • 打赏
  • 举报
回复

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧