Code: Select all
import pyb
import micropython
def sk():
count = 0
millis = pyb.millis
kon = millis() + 1000
while millis() < kon:
count += 1
print (count)
@micropython.native
def skn():
count = 0
millis = pyb.millis
kon = millis() + 1000
while millis() < kon:
count += 1
print ("native",count)
sk()
skn()
on web
normal: 268647
native: 408437
on STM32F7 (Micro Python v1.4.5-5-g3179d23 on 2015-08-15; F7DISC with STM32F746)
normal: 120744
native: 197518
Can someone explain this huge difference?