//
// TEST3.C
//
#include "test3.h"
void
_cdecl
wmain(
int argc,
wchar_t **argv,
wchar_t **envp
)
{
LARGE_INTEGER Time1,Time2;
// for periodic timer code
int i = 0 ;
LARGE_INTEGER liPeriod; // timer period
LARGE_INTEGER Time ; // the parameter used in the TimerHandler()
HANDLE hTimer; // timer handle
// RTX periodic timer code:
// TO DO: Set default timer period to your desired time.
// The period needs to be an even multiple of the HAL
// period found in the control panel.
// This example uses a period of 1 milisecond.
liPeriod.QuadPart = 9000;
// Create a periodic timer
if (! (hTimer = RtCreateTimer(
NULL, // security
0, // stack size - 0 uses default
TimerHandler, // timer handler
&Time, // NULL context (argument to handler)
RT_PRIORITY_MAX, // priority
CLOCK_3) )) // RTX HAL timer
{
// TO DO: exception code here
RtWprintf(L"RtCreateTimer error = %d\n",GetLastError());
ExitProcess(1);
}
if (! RtSetTimerRelative( hTimer,
&liPeriod,
&liPeriod) )
{
// TO DO: exception code here
RtWprintf(L"RtSetTimerRelative error = %d\n",GetLastError());
ExitProcess(1);
}
//
// TO DO: your program code here
//
RtGetClockTime(CLOCK_3,pTime);
Sleep(1000);
RtDeleteTimer( hTimer );
for (i = 2 ; i<=900 ; i++)
{
RtWprintf(L"%d\n",buffer[i].QuadPart - buffer[i-1].QuadPart);
}
ExitProcess(0);
}
软件方法测试RTX时钟
4星 · 超过85%的资源 需积分: 9 183 浏览量
2009-05-03
15:01:59
上传
评论
收藏 774KB RAR 举报
雕的天地
- 粉丝: 1
- 资源: 3
最新资源
- 基于MATLAB的钢板表面缺陷检测系统
- MS SQL里生成行政区域县区信息表和相应数据
- delphi实现DBGrid全选和反选功能
- 25C11F41-2B2A-4D1A-AAA8-7C654526B129.pdf
- Android Studio Jellyfish(android-studio-2023.3.1.18-cros.deb)
- MVC+EF框架+EasyUI实现权限管理源码程序
- python第66-75天,Day66-75.rar
- python后端服务project-of-tornado.rar
- python测验,hello-tornado.rar
- 基于SpringBoot+Vue3快速开发平台、自研工作流引擎源码设计.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈