Added int_memory.ctype.py

This commit is contained in:
anon 2024-03-10 15:57:35 +01:00
parent 53cf6a87aa
commit 72a4f384d5

10
int_memory.ctype.py Normal file
View File

@ -0,0 +1,10 @@
from ctypes import c_int
from memory_profiler import memory_usage
def create_ctypes_ints():
ctypes_ints = [c_int(i) for i in range(10000)]
return ctypes_ints
if __name__ == '__main__':
mem_usage = memory_usage(create_ctypes_ints)
print(f"Memory usage: {mem_usage[0]:.2f} MiB")