Skip to content

Commit b0ada11

Browse files
authored
Update time_algo_exec.py
1 parent daac334 commit b0ada11

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

other/time_algo_exec.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
def calc(operations: dict) -> float:
66
"""
77
calc(operation: dict) -> float:
8-
Ce programme sert à calculer le temps d'éxecution des algorithmes en fonction
9-
des opérations primitives traitées
10-
:param operations: dictionnaire des couples (nombre de fois, temps d'exécution)
11-
avec comme clé, l'opération primitive(de préférence)
12-
:return: le temps d'exécution de l'algorithme si le format de "operations" est bon,
13-
0 sinon
14-
8+
This function aims to calculate how long an algorithm take, knowing only primary operations
9+
:param operations: A dictionary where the values are tuples, consisting of the number of times
10+
an operation is performed and its execution time, and the key should
11+
preferably be the name of the operation for better clarity and usability.
12+
:return: the time needed for the execution of this algorithm(if format is okey for "operations") or 0
1513
#>>> operations1 = {"addition":(2, 0.1), "subtraction":(1, 0.2)}
1614
#>>> operations2 = {"addition":(2, 0.1), "subtraction":(1, 0.2, 1)}
1715
#>>> calc(operations1)

0 commit comments

Comments
 (0)