Timer won't tick

前端 未结 7 1764
一整个雨季
一整个雨季 2020-12-10 03:31

I have a Windows.Forms.Timer in my code, that I am executing 3 times. However, the timer isn\'t calling the tick function at all.

private int co         


        
7条回答
  •  爱一瞬间的悲伤
    2020-12-10 03:48

    Here's an Rx ticker that works:

    Observable.Interval(TimeSpan.FromSeconds(1))
    .Take(3)
    .Subscribe(x=>Console.WriteLine("tick"));
    

    Of course, you can subscribe something more useful in your program.

提交回复
热议问题