private void _timer_Elapsed(object sender, ElapsedEventArgs e) { if (count <= AppConfig.ServerOptions.CompensationRegisterRoutesCount) { _serviceRouteProvider.RegisterRoutes(Math.Round(Convert.ToDecimal(Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds), 2, MidpointRounding.AwayFromZero)).Wait(); if (_logger.IsEnabled(LogLevel.Debug)) { _logger.LogDebug($"第{count}次进行服务路由补偿注册"); } count++; } else { _timer.Stop(); _timer.Dispose(); } }