From 0667f01471f8f1032f778e90bfee09af42e63ed9 Mon Sep 17 00:00:00 2001 From: Leeingnyo Date: Sun, 12 Sep 2021 02:01:43 +0900 Subject: [PATCH] Measure scan only --- src/library/library.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/library/library.cr b/src/library/library.cr index 9351e60..32cc161 100644 --- a/src/library/library.cr +++ b/src/library/library.cr @@ -98,6 +98,7 @@ class Library end def scan + start = Time.local unless Dir.exists? @dir Logger.info "The library directory #{@dir} does not exist. " \ "Attempting to create it" @@ -122,7 +123,8 @@ class Library storage.bulk_insert_ids storage.close - Logger.debug "Scan completed" + ms = (Time.local - start).total_milliseconds + Logger.debug "Scan completed. #{ms}ms" Storage.default.mark_unavailable end