1: Stopwatch stopwatch = new Stopwatch();
2: List<string> ips = new List<string> { "218.5.3.128", "120.67.217.7", "125.78.67.175", "220.250.64.23", "218.5.3.128", "120.67.217.7", "125.78.67.175", "220.250.64.23" };
3: stopwatch.Start();
4: for (int i = 0; i < 100; i++)
5: {
6: foreach (string item in ips)
7: {
8: ip = qqWry.Query(item);
9: // Console.WriteLine("{0} {1} {2}", ip.IP, ip.Country, ip.Local);
10: }
11: }
12:
13: stopwatch.Stop();
14: Console.WriteLine("QQWryLocator 花了{0} ms", stopwatch.ElapsedMilliseconds);
15:
16: stopwatch.Reset();
17: stopwatch.Start();
18: for (int i = 0; i < 100; i++)
19: {
20: foreach (string item in ips)
21: {
22: string s = IPLocation.IPLocation.IPLocate("qqwry.dat", item);
23: // Console.WriteLine(s);
24: }
25: }
26: stopwatch.Stop();
27: Console.WriteLine("IPLocation 花了{0} ms", stopwatch.ElapsedMilliseconds);