Advertisement
DeaD_EyE

Basic Performance Test for MicroPython

Jul 1st, 2022
654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1.  
  2. """
  3. Basic Performance Test for MicroPython
  4.  
  5. https://github.com/micropython/micropython/wiki/Performance
  6. """
  7.  
  8. import time
  9.  
  10.  
  11. def performance_test():
  12.     ticks = time.ticks_ms
  13.     end_time = ticks() + 10_000
  14.     count = 0
  15.     while ticks() < end_time:
  16.         count += 1
  17.  
  18.     print("Count: ", count)
  19.  
  20.  
  21. performance_test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement