PerformenceTest.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //using CommonLang;
  2. //using System;
  3. //using ZeusServerEdgeJS;
  4. //namespace ZeusServerEdgeJSTest
  5. //{
  6. // static class PerformenceTest
  7. // {
  8. // /// <summary>
  9. // /// 应用程序的主入口点。
  10. // /// </summary>
  11. // [STAThread]
  12. // static void Main()
  13. // {
  14. // int count = 100000;
  15. // EdgeJS edge = new EdgeJS();
  16. // // var input = new { };
  17. // var input = new { type = "UnitAxisAction", object_id = 3, dx8 = 10, dy8 = 10 };
  18. // //HashMap<String, Object> map = new HashMap<String, Object>();
  19. // //map["unitType"] = "UnitAxisAction";
  20. // //map["object_id"] = 3;
  21. // //map["dx8"] = 10;
  22. // //map["dy8"] = 10;
  23. // // ZoneService.instance().start("D:/nodejs/node_global/npm/node_modules/zeus-csharp/lib/dll", "D:/nodejs/node_global/npm/node_modules/zeus-csharp/data",10886);
  24. // int startTime = DateTime.Now.Millisecond;
  25. // for (int i = 0; i < count; ++i)
  26. // {
  27. // object obj = ZoneService.instance().createMoveAction(0,0,0);
  28. // // testMethod(i);
  29. // }
  30. // int totalUse = DateTime.Now.Millisecond - startTime;
  31. // Console.WriteLine("call countTotal:" + count + ",all use:" + totalUse + ",avg use:" + (double)(totalUse ) / count);
  32. // }
  33. // static int testMethod(int input)
  34. // {
  35. // return input * 2;
  36. // }
  37. // }
  38. //}