출처 : http://stackoverflow.com/questions/5904636/best-way-to-create-a-run-once-time-delayed-function-in-c-sharp#16090276



public class PauseAndExecuter

{

    public static async void Execute(Action action, int timeoutInMilliseconds)

    {

        await Task.Delay(timeoutInMilliseconds);

        action();

    }

}

 

 

사용법

PauseAndExecuter.Execute(delegate () {

    //하고픈

    Console.Write("111, ");

}, 1000);










Posted by motolies

댓글을 달아 주세요