How to fire timer.Elapsed event immediately

前端 未结 10 1203
独厮守ぢ
独厮守ぢ 2020-12-10 00:17

I\'m using the System.Timers.Timer class to create a timer with an Timer.Elapsed event. The thing is the Timer.Elapsed event is fired

10条回答
  •  借酒劲吻你
    2020-12-10 00:59

    Task.Run(() =>
    {
       Timer_Elapsed(null, null);
    });
    

    After Timer creation/configuration, worked fine for me...

提交回复
热议问题