# HG changeset patch # User Chris Cannam # Date 1444053999 -3600 # Node ID a8a89f74338baf05b7002d4a4b19ef01b2a4c757 # Parent ece8682d8293b08bd0924d15f85ae3c16aa2567a Incremental rendering with interval timer diff -r ece8682d8293 -r a8a89f74338b fft/test.js --- a/fft/test.js Mon Oct 05 14:54:12 2015 +0100 +++ b/fft/test.js Mon Oct 05 15:06:39 2015 +0100 @@ -192,17 +192,23 @@ fft.discard(); } +var tests = [ testNayuki, testNockert, testDntj, testCross, testKissFFT ]; +var nextTest = 0; +var interval; + function test() { + clearInterval(interval); + if (nextTest < tests.length) { + f = tests[nextTest]; + nextTest++; + f(); + interval = setInterval(test, 100); + } +} +window.onload = function() { document.getElementById("test-description").innerHTML = "Running " + 2*iterations + " iterations per implementation, of FFT size " + size + ".
Timings are given separately for the first half of the run (" + iterations + " iterations) and the second half, in case the JS engine takes some warming up." - - testNayuki(); - testNockert(); - testDntj(); - testCross(); - testKissFFT(); + interval = setInterval(test(), 100); } -window.onload = test; -