summaryrefslogtreecommitdiffstats
path: root/decorators.py
blob: bc0b420a81bd7e3763affb1ada85e4e3e5a100f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import time


def log(message: str):
    def decorator(func):
        def wrapper(*args, **kwargs):
            print("TASK: " + message)
            start = time.time()
            result = func(*args, **kwargs)
            end = time.time()
            print(f"COMPLETE: {message} {round(end - start, 3)} seconds")
            return result

        return wrapper

    return decorator
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage