setInterval(function() { if((new Date) - last_time > 1000/20) { last_time = new Date; frame(); } }, 10);