博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
循环执行的类timer
阅读量:7094 次
发布时间:2019-06-28

本文共 584 字,大约阅读时间需要 1 分钟。

using System;using System.Collections.Generic;using System.Text;namespace Timer{    public class TimerManager    {        System.Timers.Timer t = new System.Timers.Timer(20000); //实例化Timer类,设置间隔时间为10000毫秒        public TimerManager()        {            t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件;               t.AutoReset = true; //设置是执行一次(false)还是一直执行(true);               t.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件;        }        //循环执行的方法        public void theout(object source, System.Timers.ElapsedEventArgs e)        {        }    }}

 

转载地址:http://dbxql.baihongyu.com/

你可能感兴趣的文章
安装和使用cocoaPods
查看>>
Erlang学习: EUnit Testing for gen_fsm
查看>>
Android开发之多媒体编程之获取图片的副本
查看>>
nginx用户认证配置( Basic HTTP authentication)
查看>>
JavaScript与DOM(上)
查看>>
关于caffe-windows中 compute_image_mean.exe出现的问题
查看>>
技术人的未来(一)——跳槽
查看>>
asp.net 下载Excel (数据流,不保存)--客户端
查看>>
复习面向对象的OOA、OOD、OOP
查看>>
poj 2891 Strange Way to Express Integers(中国剩余定理)
查看>>
是男人就下100层【第五层】——2048游戏从源代码到公布市场
查看>>
算法:最长上升下降子序列
查看>>
F - The Circumference of the Circle
查看>>
S - 骨牌铺方格(第二季水)
查看>>
svn+ssh
查看>>
h264 profile & level
查看>>
Directx11学习笔记【六】 基本的数学知识----矩阵篇
查看>>
QT分析之网络编程
查看>>
工程和界面—Webstorm入门指南 Webstorm中的工程-备
查看>>
【数据结构】链表
查看>>