pxt-common-packages
Version:
Microsoft MakeCode (PXT) common packages
19 lines (18 loc) • 526 B
text/typescript
/**
* Pause for the specified time in milliseconds
* @param ms how long to pause for, eg: 100, 200, 500, 1000, 2000
*/
//% help=loops/pause weight=99
//% async block="pause %pause=timePicker|ms"
//% blockId=device_pause blockNamespace="loops"
function pause(ms: number): void {
loops.pause(ms);
}
// micro:bit compatibility
// these functions allow some level of reuse
// between micro:bit and other maker-style editors
namespace basic {
export function pause(millis: number) {
loops.pause(millis);
}
}