Reliably sample ADC every 20ms

I’ve got an analogue signal on pin H (imp003) that I need to take a sample every 20ms from. However imp.wakeup(0.02, f) doesn’t seem to be able to handle it. It’s usually sampled every 30-40ms. Any other recommend ways of doing this?

Thanks

Have you tried using the sampler?
https://electricimp.com/docs/api/hardware/sampler/

Ah no didn’t know about that. Looks like that is exactly what I need. Thanks