THIS WORKS!
Great site sending big 2 fingers to stack exchange!
let value1 = 500
function setup() {
createCanvas(1600,1600)
noLoop()
}
const sleep = (millis) => {
return new Promise(resolve => setTimeout(resolve, millis))
}
function getRandomInt(min, max) {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min) + min)
}
async function draw() {
let time = frameCount * 20
let value2 = getRandomInt(100,500)
line( time - 20, value1, time, value2 )
value1 = value2
await sleep(100)
if (time < 1200) { redraw() } else { myProgram() }
}