From 081358c8d384dbdf29f5d5e32ada757213aea652 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Thu, 29 Jun 2023 21:38:33 +0200 Subject: [PATCH] add benchmark --- dist/contact.html | 3 ++- lib/main.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/contact.html b/dist/contact.html index da8e5a0..2aab6b9 100644 --- a/dist/contact.html +++ b/dist/contact.html @@ -100,7 +100,8 @@

-

+
diff --git a/lib/main.py b/lib/main.py index 15e41fb..6acca1f 100644 --- a/lib/main.py +++ b/lib/main.py @@ -3,6 +3,7 @@ import shutil import sys import tomllib from distutils.dir_util import copy_tree +from time import perf_counter from loguru import logger @@ -11,6 +12,7 @@ from lib.engine import FileSystemRenderer def main(): + start = perf_counter() try: config = load() except FileNotFoundError: @@ -34,7 +36,8 @@ def main(): logger.info("⏩ Start copying staticfiles to build") copy_tree(config.static_dir, os.path.join(config.out_dir)) - logger.info("🎉 Done…") + end = perf_counter() + logger.info(f"🎉 Done… in {(end - start) * 1000:.2f} ms") def parse_data(page: os.DirEntry, data_dir: str) -> dict: