From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



是否有一个函数来替代延时函数?



主要软件: LabWindows/CVI Development Systems>>LabWindows/CVI Full Development System
主要软件版本: 4.0.1
主要软件修正版本: N/A
次要软件: N/A

问题: 延时函数不能处理系统事件。这里是否有一个函数来替代延时函数?

解答: 试试下面的函数。输入参数的最低值取决于最小的计时器值。

#include <utility.h>
#include <userint.h>

int wait (double delay)
{
static double time1;
static double time2;

time1 = Timer();
time2 = Timer();
while ((time2 - time1) < delay)
{
time2 = Timer();
ProcessSystemEvents();
}

return 0;
}


相关链接:

附件:





报告日期: 12/13/2006
最近更新: 12/17/2006
文档编号: 11NGHA52