X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=blobdiff_plain;f=common%2Ftst-trie.c;h=739bd415e7a1e1575d1777e25be89c606648bbc0;hp=c9e16dc4480e272436ba2ce40f165329d8a9c3dd;hb=ab82546953101224d09dcf2e44ff170e454e7282;hpb=520b2f3bb198bfbb88b90b058ef610f0a9b980c6 diff --git a/common/tst-trie.c b/common/tst-trie.c index c9e16dc..739bd41 100644 --- a/common/tst-trie.c +++ b/common/tst-trie.c @@ -128,7 +128,14 @@ int main(int argc, char *argv[]) */ if (argc > 1) { trie = create_trie_from_file(argv[1]); - trie_inspect(trie, true); + trie_inspect(trie, false); + if (argc > 2) { + time_t now = time(NULL); + for (uint32_t i = 0 ; i < 1000000000 ; ++i) { + trie_lookup(trie, argv[2]); + } + printf("%lu lookups per second\n", 1000000000 / (time(NULL) - now)); + } trie_delete(&trie); } return 0;