# Pico/Micropython question relating to time

**URL:** <https://forums.pimoroni.com/t/pico-micropython-question-relating-to-time/16628>\
**Category:** Support\
**Created:** [March 13, 2021, 10:30pm UTC](https://forums.pimoroni.com/t/pico-micropython-question-relating-to-time/16628 "2021-03-13T22:30:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![axr624](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@axr624](https://forums.pimoroni.com/u/axr624)\
**Post date:** [March 13, 2021, 10:30pm UTC](https://forums.pimoroni.com/t/pico-micropython-question-relating-to-time/16628/1 "2021-03-13T22:30:49Z")

</div>

Hi - long time pi nerd here, got my pico + scroll pack today and have been loving it. Managed to make a lot more progress than I would have thought but there is one thing I am having trouble with…

I have some code that works on a pi zero with python 3. However when I try this on the pico I get the error “AttributeError: ‘module’ object has no attribute ‘perf\_counter’”. Now I assume that this simply isnt available in micropython, but how exactly might I confirm this? Is there any way of adding it in or enabling it?

I used the “pimoroni-pico-micropython.uf2” to start using the pico - not sure if this can be adapted or mucked about with in any way…any help would be greatly appreciated!

```
delay = d = 0.2
print(60 / delay, 'bpm')
prev = time.perf_counter()
for i in range(50):
    sleep(d)
    t = time.perf_counter()
    delta = t - prev - delay
    print('{:+.9f}'.format(delta))
    bflash(100,100,100,0.1) # this is to flash the blinkt phat I have
    d -= delta
    prev = t
```

---

<div class="post-metadata">

**Author:** ![axr624](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@axr624](https://forums.pimoroni.com/u/axr624)\
**Post date:** [March 18, 2021, 11:17am UTC](https://forums.pimoroni.com/t/pico-micropython-question-relating-to-time/16628/2 "2021-03-18T11:17:57Z")

</div>

I will write down what I have since done, in case anyone else might see this…

I’m not sure how/why but it seems that importing time actually imports utime - I only noticed this from looking at the variables window in thonny. Then I googled utime in micropython and found this [utime – time related functions — MicroPython 1.14 documentation](https://docs.micropython.org/en/latest/library/utime.html). perf\_counter could then be replaced with ticks\_ms.
