是否有一个函数来替代延时函数?
主要软件: 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
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.