take the ip parse for costs stats

This commit is contained in:
lionsoul2014 2025-12-29 19:35:43 +08:00
parent ad08637d21
commit 02e10db478
1 changed files with 5 additions and 2 deletions

View File

@ -239,6 +239,9 @@ public class SearcherTest {
return;
}
// mark the start time
long sTime = System.nanoTime();
byte[] sip;
try {
sip = Util.parseIP(ps[0]);
@ -264,9 +267,7 @@ public class SearcherTest {
}
for (final byte[] ip : new byte[][]{sip, eip}) {
long sTime = System.nanoTime();
String region = searcher.search(ip);
costs += System.nanoTime() - sTime;
// check the region info
if (!ps[2].equals(region)) {
@ -277,6 +278,8 @@ public class SearcherTest {
count++;
}
costs += System.nanoTime() - sTime;
}
reader.close();