feat(make.py): add timer
icyphox icyph0x@protonmail.com
Sun, 18 Mar 2018 11:31:55 +0530
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
make.py
→
make.py
@@ -2,6 +2,7 @@ from markdown2 import markdown_path
import os import sys import jinja2 +import time # import config file try:@@ -35,6 +36,7 @@ return html_text
def main(): + start = time.process_time() template_file = TEMPL_PATH + '/index.html' for page in os.listdir(PAGES_PATH): html_text = markdown_render(page)@@ -45,7 +47,8 @@ output = jinja_render(html_text, template_file)
with open(os.path.join(html_path, 'index.html'), 'w') as f: f.write(output) print('Rendered %s' % (page)) - + print('Done in %0.5fs' % (time.process_time() - start)) + if __name__ == "__main__": main()