The speed is really limited by either the execution speed of the JavaScript in the case of analogRead, or the speed of the timer system for Waveforms - it's not really a hardware issue.
If you absolutely require the speed it'd be possible to use Poke commands to set the hardware up to use DMA with analogRead (or you could compile in your own code that did this in C, which might be easier).
What do you need it for though? Since Espruino doesn't execute JavaScript that quickly, you would struggle to actually do much with data captured at 2MS/sec unless you were just capturing it for use with something else.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The speed is really limited by either the execution speed of the JavaScript in the case of analogRead, or the speed of the timer system for Waveforms - it's not really a hardware issue.
If you absolutely require the speed it'd be possible to use Poke commands to set the hardware up to use DMA with analogRead (or you could compile in your own code that did this in C, which might be easier).
What do you need it for though? Since Espruino doesn't execute JavaScript that quickly, you would struggle to actually do much with data captured at 2MS/sec unless you were just capturing it for use with something else.