added some timing
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user