如何找出如果定时器运行? [英] How to find out if a Timer is running?

查看:121
本文介绍了如何找出如果定时器运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个System.Timers.Timer的,有一个很长的时间间隔的一个实例 - ?说1分钟,我怎么能找到,如果它被启动,而无需等待蜱

If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?

推荐答案

System.Timer.Timer.Enabled 应该工作,当你调用开始,它可将启用以TRUE,停止,它设置为false。

System.Timer.Timer.Enabled should work, when you call "Start" it sets Enabled to TRUE, "Stop" sets it to FALSE.

这篇关于如何找出如果定时器运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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