$w.onReady(()=>{
$w('#text37').onViewportEnter(()=>{
let count = 0 //start time
const endTime = 10000 // end time
const interval = 100 // interval between counts ms
const counter = setInterval(() => {
$w('#text').text = String(count) // update text
count === endTime && clearInterval(counter) // clears the interval when count is equal to endTime
count++ // increment count
}, interval)
})
})