Last active
June 21, 2021 22:51
-
-
Save andreagrioni/a441959aa6700ae662eaac13251f0d39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comprehension | |
actions = [1,2,3] | |
accepted = [1,2] | |
eval_args = { (action) : (True if action in accepted else False) for action in actions } | |
# time I | |
import timeit | |
def ciao(): | |
a = sum([ i for i in range(0,1000)] ) | |
return(a) | |
timeit.timeit("ciao()", number=1000, setup="from __main__ import ciao") | |
# time II | |
import time | |
start_time = time.time() | |
end = time.time() - start_time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment