2015-04-04 17:05:30 -04:00
|
|
|
# tests meminfo functions in micropython module
|
|
|
|
|
|
|
|
import micropython
|
|
|
|
|
|
|
|
# these functions are not always available
|
2021-03-15 09:57:36 -04:00
|
|
|
if not hasattr(micropython, "mem_total"):
|
|
|
|
print("SKIP")
|
2015-04-04 17:05:30 -04:00
|
|
|
else:
|
|
|
|
t = micropython.mem_total()
|
|
|
|
c = micropython.mem_current()
|
|
|
|
p = micropython.mem_peak()
|
|
|
|
|
|
|
|
l = list(range(10000))
|
|
|
|
|
|
|
|
print(micropython.mem_total() > t)
|
|
|
|
print(micropython.mem_current() > c)
|
|
|
|
print(micropython.mem_peak() > p)
|