tests/int_memory.ctype.py
2024-03-10 15:57:35 +01:00

11 lines
295 B
Python

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")