diff -r be8ee2240a17 -r 23cd36180bf9 2048.html --- a/2048.html Thu Sep 25 00:54:13 2014 +0300 +++ b/2048.html Thu Sep 25 01:10:01 2014 +0300 @@ -163,6 +163,7 @@ +
profile

@@ -636,6 +637,9 @@ document.getElementById("visual-finish").addEventListener("click", ui.action.visualFinish, false); ui.action.finish = function() { + var isProfile = document.getElementById("profile").checked; + if (isProfile) + console.profile(); if ( ! ui.ai.current) { ui.game.setMessage('Select AI!'); return; @@ -668,6 +672,8 @@ ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3))); ui.game.setMessage("Game over!"); ui.ai.current.cleanup(); + if (isProfile) + console.profileEnd(); } document.getElementById("finish").addEventListener("click", ui.action.finish, false);