на скорую руку
<div id="box"></div>
<script>
(function() {
var startTime = new Date();
var elem = document.getElementById( 'box' );
var timer = setInterval( function() {
var timeDifference = ( new Date() ) - startTime;
if ( timeDifference > 10000 ) {
clearInterval( timer );
alert( 1 );
} else {
elem.innerHTML = timeDifference / 1000;
}
}, 1000 );
})();
</script>