BenchmarkComponentE.cs 586 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using Base;
  3. using Model;
  4. namespace Controller
  5. {
  6. [DisposerEvent(typeof(BenchmakComponent))]
  7. public static class BenchmakComponentE
  8. {
  9. public static async void Awake(this BenchmakComponent component, string address)
  10. {
  11. try
  12. {
  13. NetOuterComponent networkComponent = Game.Scene.GetComponent<NetOuterComponent>();
  14. for (int i = 0; i < 100; i++)
  15. {
  16. await Game.Scene.GetComponent<TimerComponent>().WaitAsync(10);
  17. component.TestAsync(networkComponent, address, i);
  18. }
  19. }
  20. catch (Exception e)
  21. {
  22. Log.Error(e.ToString());
  23. }
  24. }
  25. }
  26. }