From 5fc9ccb46e266ad868627080baf4cd617fa689f0 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 19 May 2026 22:57:12 +0200 Subject: [PATCH] added some timing --- check_ldap.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/check_ldap.py b/check_ldap.py index 1dedaf0..187a17d 100755 --- a/check_ldap.py +++ b/check_ldap.py @@ -1,6 +1,8 @@ #!/usr/bin/env python import argparse +import timeit +from functools import partial from getpass import getpass from auth.psildap import get_data @@ -17,4 +19,13 @@ data = get_data(username, password) print(data) +times = timeit.repeat(partial(get_data, username, password), number=1, repeat=5) + +for i, t in enumerate(times, 1): + print(f"run {i}: {t:.6f}s") + +avg = sum(times) / len(times) +print(f"average: {avg:.6f}s") + +