diff --git a/lib/cli/commands/query_kanji.dart b/lib/cli/commands/query_kanji.dart index c5be8bd..b1cf3c2 100644 --- a/lib/cli/commands/query_kanji.dart +++ b/lib/cli/commands/query_kanji.dart @@ -29,12 +29,16 @@ class QueryKanji extends Command { libsqlitePath: argResults!.option('libsqlite')!, ); + final time = Stopwatch()..start(); final result = await JaDBConnection(db).searchKanji('漢'); + time.stop(); if (result == null) { print("No such kanji"); } else { print(JsonEncoder.withIndent(' ').convert(result.toJson())); } + + print("Query took ${time.elapsedMilliseconds}ms"); } } diff --git a/lib/cli/commands/query_word.dart b/lib/cli/commands/query_word.dart index 9054ace..b5a39b1 100644 --- a/lib/cli/commands/query_word.dart +++ b/lib/cli/commands/query_word.dart @@ -29,7 +29,9 @@ class QueryWord extends Command { libsqlitePath: argResults!.option('libsqlite')!, ); + final time = Stopwatch()..start(); final result = await JaDBConnection(db).searchWord('かな'); + time.stop(); if (result == null) { print("Invalid search"); @@ -39,5 +41,7 @@ class QueryWord extends Command { print(JsonEncoder.withIndent(' ') .convert(result.map((e) => e.toJson()).toList())); } + + print("Query took ${time.elapsedMilliseconds}ms"); } }