Updated Performance (markdown)

Jon Hylands 2014-01-29 15:43:29 -08:00
parent 53609f285c
commit 52e4a9092a
1 changed files with 9 additions and 6 deletions

@ -1,14 +1,17 @@
Here's a sample little tight counter loop, running for 10 seconds on 3 different setups: Here's a sample little tight counter loop, running for 10 seconds on 3 different setups:
**MicroPython on Teensy 3.1: (96Mhz ARM)** **MicroPython on Teensy 3.1: (96Mhz ARM)**
Damien gave me a hint, and told me to put the performance test inside a function, rather than global. It almost doubles the execution speed, which used to run 396,505 times.
endTime = pyb.millis() + 10000 def performanceTest():
count = 0 endTime = pyb.millis() + 10000
while pyb.millis() < endTime: count = 0
count += 1 while pyb.millis() < endTime:
print("Count: ", count) count += 1
print("Count: ", count)
performanceTest()
**Count: 396,505** **Count: 659,770**
*** ***