Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SDA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien David
SDA
Commits
9b64515d
Commit
9b64515d
authored
5 years ago
by
david
Browse files
Options
Downloads
Patches
Plain Diff
Commentaires python
parent
c4a60da3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TP1/Python/main.py
+4
-4
4 additions, 4 deletions
TP1/Python/main.py
with
4 additions
and
4 deletions
TP1/Python/main.py
+
4
−
4
View file @
9b64515d
...
...
@@ -6,21 +6,21 @@ from analyzer import Analyzer
# Tableau dynamique.
a
=
ArrayListProxy
()
# Analyse du temps pris par les op
é
rations.
# Analyse du temps pris par les op
e
rations.
time_analysis
=
Analyzer
();
for
i
in
range
(
1000000
):
before
=
time
.
time
()
a
.
append
(
i
)
after
=
time
.
time
()
# Enregistrement du temps pris par l'op
é
ration
# Enregistrement du temps pris par l'op
e
ration
time_analysis
.
append
((
after
-
before
)
*
10
**
9
)
# Affichage de quelques statistiques sur l'exp
é
rience.
# Affichage de quelques statistiques sur l'exp
e
rience.
sys
.
stderr
.
write
(
"
Total cost :
"
+
str
(
time_analysis
.
get_total_cost
())
+
"
\n
"
)
sys
.
stderr
.
write
(
"
Average cost :
"
+
str
(
time_analysis
.
get_average_cost
())
+
"
\n
"
)
sys
.
stderr
.
write
(
"
Variance :
"
+
str
(
time_analysis
.
get_variance
())
+
"
\n
"
)
sys
.
stderr
.
write
(
"
Standard deviation :
"
+
str
(
time_analysis
.
get_standard_deviation
())
+
"
\n
"
)
//
Sauvegarde
les
donn
é
es
de
l
'
exp
é
rience
: temps et temps amorti par opération
.
#
Sauvegarde les donn
e
es de l'exp
e
rience.
time_analysis
.
save_values
(
"
../dynamic_array_time_python.plot
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment