Created
July 23, 2020 16:00
-
-
Save biancarosa/ace9ee9232792495ee86a82259ba8a55 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
import cProfile | |
import timeit | |
import ctypes | |
N = 100000 | |
start = timeit.default_timer() | |
array = (N * ctypes.c_int)() | |
stop = timeit.default_timer() | |
print('Time: ', stop - start) | |
start = timeit.default_timer() | |
array = (N * ctypes.c_int64)() | |
stop = timeit.default_timer() | |
print('Time: ', stop - start) | |
start = timeit.default_timer() | |
array = (N * ctypes.py_object)() | |
stop = timeit.default_timer() | |
print('Time: ', stop - start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Time: 0.0003639560000010533
Time: 0.0007921180003904738
Time: 0.0008451479998257128