cours-snt/nsi_python/timer/sujet.tex
2022-01-31 09:39:27 +01:00

29 lines
550 B
TeX
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[11pt,a4paper]{../../template/template_cours}
\usepackage{listings}
\usepackage{minted}
\title{Mesurer un temps dexécution en Python}
\author{Adrian Amaglio}
\def\thesequence{Python}
\def\thelevel{NSI}
\begin{document}
\begin{minted}{python}
import time
def fonction_inutile ():
a = 0
for i in range (10):
a = a**i
return a
start_time = time.time()
fonction_inutile()
end_time = time.time()
temps_execution = end_time - start_time
print("La fonction a mis : ", temps_execution)
\end{minted}
\end{document}