delay-check/script.js


var global_count = 0;

function check(count)
{
	// Do something
	if(count == global_count)
	{
		$('#output').html(count);
	}
}


$(function()
{
	check(0);
	$('#input').keypress(function()
	{
		setTimeout(check, 1000, ++global_count);
	});
});