function similar %timeit

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
stmfresser
Posts: 22
Joined: Sat Jun 20, 2015 11:48 am

function similar %timeit

Post by stmfresser » Fri Aug 19, 2016 5:28 pm

i would calculate the time of operation. Is there any function like %timeit ?

User avatar
pythoncoder
Posts: 4924
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: function similar %timeit

Post by pythoncoder » Sat Aug 20, 2016 5:35 am

This allows any function to be timed by prefixing it with a decorator https://github.com/peterhinch/micropyth ... ed_func.py
Peter Hinch

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: function similar %timeit

Post by pfalcon » Sat Aug 20, 2016 1:20 pm

It's unclear what "%timeit" is. The port standard of standard Python module "timeit" exists in micropython-lib: https://github.com/micropython/micropyt ... ter/timeit
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply