Pico/Micropython question relating to time

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

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. perf_counter could then be replaced with ticks_ms.