zoukankan      html  css  js  c++  java
  • myTimer

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.Remoting.Messaging;
    using System.Timers;
    using Logger;
    
    namespace Untitly
    {
       public   class myTimer
        {
        
           public static  System.Timers.Timer timers;
           public   myTimer()
           {
               
           }
           public void time() {
               timers = new System.Timers.Timer(10000);
               timers.Elapsed += new ElapsedEventHandler(myTimer_Elapsed);
               timers.Enabled = true;
               timers.AutoReset = true;
           }
           public delegate string GetLogDelegate();
           private static string GetLogs()
           {
    
               return DateTime.Now.ToString();
           }
           private static  void LogTableCallBack(IAsyncResult tag)
           {
               AsyncResult result = (AsyncResult)tag;
               GetLogDelegate del = (GetLogDelegate)result.AsyncDelegate;
               Test.Write(del.EndInvoke(tag));
    
           }
    
          static  void myTimer_Elapsed(object source, ElapsedEventArgs e)
           {
               try
               {
                   GetLogDelegate getLogDel = new GetLogDelegate(GetLogs);
    
                   getLogDel.BeginInvoke(new AsyncCallback(LogTableCallBack), null);
               }
               catch (Exception ex)
               {
                   Log.WriteErrorLog(ex);
               }
           }
        }
    }
    

      

  • 相关阅读:
    css半透明边框
    css脱离文档流
    margin负值的作用
    浅谈BFC
    css多列布局
    css布局--水平垂直居中
    css布局--垂直居中
    css布局--水平居中
    题解-APIO2019奇怪装置
    题解-AtCoder ARC-078F Mole and Abandoned Mine
  • 原文地址:https://www.cnblogs.com/jiebian/p/2628133.html
Copyright © 2011-2022 走看看