annotate (rough) running times

This commit is contained in:
Maximilian Keßler 2022-02-09 21:20:34 +01:00
parent f1dbc45f9c
commit bcebdfd86f

View file

@ -1,4 +1,5 @@
import json
import time
from pathlib import Path
from typing import Optional, Union, List, Tuple, Set
import shutil
@ -290,18 +291,19 @@ class PyTeXBuilder:
def _build(self) -> bool:
logger.info("Starting build")
self._load_pytex_files()
self._load_pytex_files() # 8ms
logger.info(f"Found {len(self._pytex_files)} source files")
self._init_output_files()
self._init_output_files() # 1ms
logger.info(f"Found {len(self._output_files)} potential files to build.")
self._compute_files_to_build()
self._compute_files_to_build() # 1ms
if len(self._files_to_build) == 0:
logger.info(f"Everything up to date, nothing to build!")
return True
logger.info(f"Needing to build {len(self._files_to_build)} many files.")
self._check_output_directory_integrity()
self._check_output_directory_integrity() # 1ms
logger.info(f"Starting build")
self._build_files()
self._build_files() # 53 ms
logger.info(f"Built files")
self._move_files()
self._write_version_info()
return True