public void Test_GeobaseEngineDirrect_Test_FindLocationByIp() { var stopwatch = Stopwatch.StartNew(); GeobaseEngineTest.Test_FindLocationByIp(engineDirrect); Console.WriteLine("Test_GeobaseEngineDirrect_Test_FindLocationByIp search time: " + stopwatch.Elapsed.TotalMilliseconds + " ms."); }
public void Test_GeobaseEngineDirrect_Test_FindLocationByIp_Multithreading() { var stopwatch = Stopwatch.StartNew(); int tasksCount = 1000; var tasks = new Task[tasksCount]; for (int i = 0; i < tasksCount; i++) { tasks[i] = Task.Factory.StartNew(() => GeobaseEngineTest.Test_FindLocationByIp(engineDirrect)); } Task.WaitAll(tasks); Console.WriteLine("Test_GeobaseEngineDirrect_Test_FindLocationByIp_Multithreading search time: " + stopwatch.Elapsed.TotalMilliseconds + " ms."); }