4 ms·
Best I've got is ``` var speed_x = 50, speed_y = 2, step = 20, stop_after = 60 * 1000; var t = setInterval(function(){ // scrollY
by tetris11 3y ago
Best I've got is
```
var speed_x = 50, speed_y = 2,
step = 20, stop_after = 60 * 1000;
var t = setInterval(function(){
// scrollY faster for larger text
let ymod = 1 + (50 * ((scrollY / scrollMaxY)**2))
window.scrollBy(speed_x, speed_y * ymod)
if ((scrollX >= scrollMaxX) || (scrollX <= 0)){
speed_x = -speed_x
}
if ((scrollY >= scrollMaxY) || (scrollY <= 0)){
speed_y = -speed_y
}
}, step);
setTimeout(function(){clearTimeout(t)}, stop_after)
```