zoukankan      html  css  js  c++  java
  • System.Timers.Timer的使用

    System.Timers.Timer的使用
    2008年11月04日 星期二 05:26 P.M.
  • using System;   
  •   
  • using System.Collections.Generic;   
  •   
  • using System.Linq;   
  •   
  • using System.Text;   
  •   
  • using System.Timers;   
  •   
  •   
  •   
  • namespace ConsoleApplication1   
  •   
  • {   
  •   
  •     class Program   
  •   
  •      {   
  •   
  •         static void Main(string[] args)   
  •   
  •          {   
  •   
  •              System.Timers.Timer aTimer = new System.Timers.Timer();   
  •   
  •              aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);   
  •   
  •             // Set the Interval to 5 seconds.   
  •   
  •              aTimer.Interval = 5000;   
  •   
  •              aTimer.Enabled = true;   
  •   
  •   
  •   
  •              Console.WriteLine("Press \'q\' to quit the sample.");   
  •   
  •             while (Console.Read() != 'q') ;   
  •   
  •          }   
  •   
  •   
  •   
  •         private static void OnTimedEvent(object source, ElapsedEventArgs e)   
  •   
  •          {   
  •   
  •              Console.WriteLine("Hello World!");   
  •   
  •          }   
  •   
  •      }   
  •   
  • }
查看全文
  • 相关阅读:
    BZOJ 4805: 欧拉函数求和 杜教筛
    BZOJ 2694: Lcm 莫比乌斯反演 + 积性函数 + 线性筛 + 卡常
    BZOJ 2693: jzptab 莫比乌斯反演 + 积性函数 + 筛法
    BZOJ 2154: Crash的数字表格 莫比乌斯反演
    BZOJ 3884: 上帝与集合的正确用法 扩展欧拉定理 + 快速幂
    BZOJ 3595: [Scoi2014]方伯伯的Oj Splay + 动态裂点 + 卡常
    GitHub的使用
    Selenium模块的安装
    关于__new__和__init__
    博客一键保存本地exe可视化界面文件
  • 原文地址:https://www.cnblogs.com/aaa6818162/p/1576496.html
  • Copyright © 2011-2022 走看看