/*

 http://sosal.kr/
 * made by so_Sal
 */



System 안에있는 타이머를 사용하면 된다.

using System.Timers;

 



class Program

{

    private static Timer aTimer;


    static void Main(string[] args)

    {

 

        // 2초의 interval을 둔 timer 만들기

        aTimer = new System.Timers.Timer(2000);


        // Hook up the Elapsed event for the timer.

        aTimer.Elapsed += OnTimedEvent;

        aTimer.Enabled = true;

 

        Console.WriteLine("Press the Enter key to exit the program... ");

        Console.ReadLine();

        Console.WriteLine("Terminating the application...");

    }

    private static void OnTimedEvent(Object source, ElapsedEventArgs e)

    {

        Console.WriteLine("The Elapsed event was raised at {0}", e.SignalTime);

    }

}





OnTimedEvent가 2초마다 계속 실행되는 모습을 볼 수 있다.

저작자 표시 비영리 변경 금지
신고
Posted by sosal sosal

댓글을 달아 주세요

  1. 2016.04.18 13:38 신고

    없알< p > Apple interrupted victims die,tn requin pas cher, some applicants leg model,hogan outlet, led on the Internet; some of the private shoot dew photos, after the event was widely circulated, angry but helpless. Investigation of the case, the criminal victim is called Bureau report,cheap ray ban uk, the police can help please remove the porn industry inside.



    writer Liao Huiying believes 메에

  2. 2016.04.27 13:39 신고

    에마but, until 11 am,air max 1 outlet, did not see the winning students and parents figure. The relevant person in charge of the college after receiving a call, apologize to reporters, said: I am sorry! Winning students' parents have some concerns, do not want to accept the reporter interviewed."









    college students in charge of the work of the relevant person in charge of Liu,hogan ou관리