vb.net计时器 [英] vb.net timer

查看:85
本文介绍了vb.net计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述








)我想要构建  2 应用程序与vb.net和c#(分离)





我有1个camrera(一个videocapx) 我使用videocapx activex进行相机通信,我需要每秒(或更少)间隔



做快照并与之前的快照进行比较。喜欢运动,但间隔时间不是每一帧。



和其他计时器只计算时间并连接到IO卡,



2个计时器必须一起开始和结束并分享几个变量。



我的问题:



怎么做?只有2个.net的定时器或者使用其他?



我需要线程吗?





谢谢



Eli

解决方案

根本不要使用计时器......


只需运行一个带循环的后台线程并监控循环执行时间。然后,您可以使用两个单独的计数器变量来跟踪运行时间,并在每个变量达到指定阈值时执行每个过程。



)I want build  2 applications with vb.net and c# (seperated)

I have 1 camrera (one videocapx)  i iuse videocapx activex for camera communication and i need each second(or less) interval

to do snapshot and to compare with the one before. like motion but in interval time not each frame.

and other timer just count time and connect to IO card,

the 2 timers must start and end together and share few varibles.

my questions:

how to do it? just 2 timers of .net or use other?

do i need threads?

Thanks

Eli

解决方案

Don't use timers at all...

Just run one background thread with a loop and monitor the loop execution time.  You can then use two separate counter variables to keep track of run time and perform each process when each variable reaches the specified threshold.


这篇关于vb.net计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆