示例#1
0
        public async Task TestStartAsync()
        {
            ITimer timer = new Utils.Timer.Timer(AverageTime.OneMinute);

            timer.OnTime += time => Console.WriteLine($"{DateTime.Now}   {time}");
            await timer.StartAsync();

            await Task.Delay(5 * 60 * 1000);
        }
示例#2
0
        public async Task TestStopAsync()
        {
            ITimer timer = new Utils.Timer.Timer(AverageTime.OneMinute);
            await timer.StartAsync();

            await Task.Delay(2000);

            await timer.StopAsync();
        }