Added int_memory.ctype.py
This commit is contained in:
parent
53cf6a87aa
commit
72a4f384d5
10
int_memory.ctype.py
Normal file
10
int_memory.ctype.py
Normal 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")
|
Loading…
x
Reference in New Issue
Block a user