c++ - 无法从 GetSystemTime() 获取毫秒数

标签 c++ visual-studio-2008-sp1 platform-builder

我正在尝试打印出秒和毫秒分辨率计时,我正在使用 GetSystemTime()

这是我的代码:

GetSystemTime(&datetime);
RETAILMSG(1,(_T("Time After Data Sent to USB: %d:%d\r\n"), datetime.wSecond, datetime.wMilliseconds));  

我使用 RETAILMSG() 打印到平台构建器调试输出,但我只能打印到秒分辨率,所以我会看到类似 48:0 毫秒为空。

我不确定为什么会这样,因为我没有收到任何投诉。我认为它与 RETAILMSG() 的实现有关。

是否有解决此问题的方法或可用于实现毫秒分辨率的替代方法?

谢谢,

编辑:我在 Windows Embedded Compact 7 中开发

最佳答案

the milliseconds is blank.

I am not sure why this is happening

Embedded Compact documentation对于 GetSystemTime() 声明了关于该问题的以下警告:

Millisecond granularity may not be supported by a hardware platform. The caller of this function should not rely on more than second granularity.

关于c++ - 无法从 GetSystemTime() 获取毫秒数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31950972/

相关文章:

c++ - x3::symbols 移动结果,因此将其从 symbol_parser 本身中删除

windows-ce - 如何下载 Windows CE 5.0 的 Platform Builder?

visual-studio - 如何在 VS2008 中启用 Platform Builder 模式

c++ - 将 JSON 文档转换为 Parquet

c++ - 在 SDL 1.3 中创建 OpenGL 3.2/3.x 上下文

c++ - 当缓冲区缩小时,是否保证 realloc 就位?

c++ - 如何在 C++ 中计算 10 位小数精度的 double 变量

winforms - 在 Visual Studio 中隐藏警告的特定实例?

jquery - VS2008 jQuery Intellisense 不工作 - (jquery-1.4.1.js)

windows - 通过 Platform Builder 向 Windows CE 6.0 添加设备驱动程序