So we don't have any way to check source code of a python file after moving to dir() of a device
Import inspect would have been handy, though
Search found 5 matches
- Thu Dec 19, 2019 3:49 pm
- Forum: General Discussion and Questions
- Topic: inspect.getargspec for function signature
- Replies: 4
- Views: 3672
- Thu Nov 14, 2019 3:16 pm
- Forum: General Discussion and Questions
- Topic: timeit function not available in machine module
- Replies: 6
- Views: 3253
Re: timeit function not available in machine module
Okpythoncoder wrote: ↑Sat Nov 09, 2019 9:16 amYou'll find a way to time a function call using a decorator here e.g.Code: Select all
@timed_function def test(): utime.sleep_us(10000)
I'll test
Thanks
In case of any doubt I'll get back to you
- Sat Nov 09, 2019 9:05 am
- Forum: General Discussion and Questions
- Topic: timeit function not available in machine module
- Replies: 6
- Views: 3253
Re: timeit function not available in machine module
Thanksjimmo wrote: ↑Thu Nov 07, 2019 8:47 pmTo save space, MicroPython doesn't include the whole of the Python standard library.
However you can install some things (including timeit) manually from micropython-lib -- e.g. https://github.com/micropython/micropyt ... ter/timeit
I will check
- Sat Nov 09, 2019 9:03 am
- Forum: General Discussion and Questions
- Topic: timeit function not available in machine module
- Replies: 6
- Views: 3253
Re: timeit function not available in machine module
That timeit function in the micropython-lib looks like overkill, and certainly not made for esp8266. In that situation, I usually time a function using utime.ticks_us() and utime.ticks_diff(). Edit: I faintly remember that Dave @dhylands had written something more reusable, but than might have been...
- Thu Nov 07, 2019 2:43 pm
- Forum: General Discussion and Questions
- Topic: timeit function not available in machine module
- Replies: 6
- Views: 3253
timeit function not available in machine module
I went through some posts here but could not find them helpful
I used esptool for importing micropython into my wemos D1 mini
However, I'm trying to find a way to calculate code execution time using in-built function 'timeit',
but it's not there
Anybody found a solution for this
Thanks
I used esptool for importing micropython into my wemos D1 mini
However, I'm trying to find a way to calculate code execution time using in-built function 'timeit',
but it's not there
Anybody found a solution for this
Thanks