Search found 5 matches

by giri
Thu Dec 19, 2019 3:49 pm
Forum: General Discussion and Questions
Topic: inspect.getargspec for function signature
Replies: 4
Views: 1390

Re: inspect.getargspec for function signature

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
by giri
Thu Nov 14, 2019 3:16 pm
Forum: General Discussion and Questions
Topic: timeit function not available in machine module
Replies: 6
Views: 780

Re: timeit function not available in machine module

pythoncoder wrote:
Sat Nov 09, 2019 9:16 am
You'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)
Ok
I'll test
Thanks
In case of any doubt I'll get back to you
by giri
Sat Nov 09, 2019 9:05 am
Forum: General Discussion and Questions
Topic: timeit function not available in machine module
Replies: 6
Views: 780

Re: timeit function not available in machine module

jimmo wrote:
Thu Nov 07, 2019 8:47 pm
To 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
Thanks
I will check
by giri
Sat Nov 09, 2019 9:03 am
Forum: General Discussion and Questions
Topic: timeit function not available in machine module
Replies: 6
Views: 780

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...
by giri
Thu Nov 07, 2019 2:43 pm
Forum: General Discussion and Questions
Topic: timeit function not available in machine module
Replies: 6
Views: 780

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