32 lines
563 B
Python
Executable File
32 lines
563 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import timeit
|
|
from functools import partial
|
|
from getpass import getpass
|
|
|
|
from stand.auth.psildap import get_data
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("username")
|
|
clargs = parser.parse_args()
|
|
|
|
username = clargs.username
|
|
password = getpass()
|
|
|
|
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")
|
|
|
|
|
|
|