From e847d2780926a35eaa803036808a492ee86bf5bd Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Tue, 7 Jun 2022 20:10:59 +0200 Subject: [PATCH] added timer to import --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index d08533c..aff7a5e 100644 --- a/main.py +++ b/main.py @@ -38,6 +38,7 @@ def import2sql(): conn = sqlite3.connect('app.db') list = [] + start_time = timeit.default_timer() for root, dirs, files in os.walk(os.path.abspath(config.CONTENT_BASE_DIR)): for file in files: f = os.path.join(root, file) @@ -63,7 +64,10 @@ def import2sql(): conn.commit() conn.close() - return "yay" + elapsed = timeit.default_timer() - start_time + print(elapsed) + + return str(elapsed) @app.route("/content/") @auth.login_required