Det gør man med javascript:
<script>
function countdown(callback,n){
if(typeof n != 'number') {
var n = 3;
}
alert(n);
if(n > 0) {
n--;
var f = function() { countdown(callback,n); };
setTimeout(f,1000);
} else {
callback();
}
}
var f = function(){ alert('Done'); };
countdown(f,null);
</script>